RESOLVED FIXED 162646
URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
https://bugs.webkit.org/show_bug.cgi?id=162646
Summary URLParser: Handle windows drive letters after two slashes in relative URLs ac...
Alex Christensen
Reported 2016-09-27 17:06:08 PDT
URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
Attachments
Patch (7.90 KB, patch)
2016-09-27 17:06 PDT, Alex Christensen
saam: review+
Alex Christensen
Comment 1 2016-09-27 17:06:55 PDT
Saam Barati
Comment 2 2016-09-27 17:30:05 PDT
Comment on attachment 290028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290028&action=review r=me > Source/WebCore/platform/URLParser.cpp:1457 > + bool windowsQuirk = c.codeUnitsSince(authorityOrHostBegin) == 2 && isWindowsDriveLetter(authorityOrHostBegin); Isn't the ==2 check redundant here since isWindowsDriveLetter only returns true if you've moved 2 points along? Or is the goal to quickly rule out the isWindowsDriveLetter(...) check? > Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:643 > + checkRelativeURLDifferences("//C|/foo/bar", "file:///tmp/mock/path", I never knew "|" is OK there.
Alex Christensen
Comment 3 2016-09-27 17:33:48 PDT
Comment on attachment 290028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290028&action=review >> Source/WebCore/platform/URLParser.cpp:1457 >> + bool windowsQuirk = c.codeUnitsSince(authorityOrHostBegin) == 2 && isWindowsDriveLetter(authorityOrHostBegin); > > Isn't the ==2 check redundant here since isWindowsDriveLetter only returns true if you've moved 2 points along? > Or is the goal to quickly rule out the isWindowsDriveLetter(...) check? It's needed for correctness. isWindowsDriveLetter(iterator) returns true if the String the iterator is pointing to starts with C: but I need it to fail if it contains more than just C: This is covered by the test with //C:asdf/foo/bar >> Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:643 >> + checkRelativeURLDifferences("//C|/foo/bar", "file:///tmp/mock/path", > > I never knew "|" is OK there. It's equivalent to a : in this case, but when canonicalized it becomes a :, so it's a syntax violation.
Alex Christensen
Comment 4 2016-09-27 17:34:15 PDT
Note You need to log in before you can comment on or make changes to this bug.