Title: [206218] trunk
Revision
206218
Author
achristen...@apple.com
Date
2016-09-21 11:00:19 -0700 (Wed, 21 Sep 2016)

Log Message

URLParser: correctly parse relative URLs that are just one character
https://bugs.webkit.org/show_bug.cgi?id=162344

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206217 => 206218)


--- trunk/Source/WebCore/ChangeLog	2016-09-21 17:44:43 UTC (rev 206217)
+++ trunk/Source/WebCore/ChangeLog	2016-09-21 18:00:19 UTC (rev 206218)
@@ -1,3 +1,15 @@
+2016-09-21  Alex Christensen  <achristen...@webkit.org>
+
+        URLParser: correctly parse relative URLs that are just one character
+        https://bugs.webkit.org/show_bug.cgi?id=162344
+
+        Reviewed by Tim Horton.
+
+        Covered by new API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parse):
+
 2016-09-21  Daniel Bates  <daba...@apple.com>
 
         REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad

Modified: trunk/Source/WebCore/platform/URLParser.cpp (206217 => 206218)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-09-21 17:44:43 UTC (rev 206217)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-09-21 18:00:19 UTC (rev 206218)
@@ -998,7 +998,12 @@
             LOG_STATE("SchemeStart");
             if (isASCIIAlpha(*c)) {
                 m_asciiBuffer.uncheckedAppend(toASCIILower(*c));
-                ++c;
+                incrementIteratorSkippingTabAndNewLine<serialized>(c);
+                if (c.atEnd()) {
+                    m_asciiBuffer.clear();
+                    state = State::NoScheme;
+                    c = beginAfterControlAndSpace;
+                }
                 state = State::Scheme;
             } else
                 state = State::NoScheme;

Modified: trunk/Tools/ChangeLog (206217 => 206218)


--- trunk/Tools/ChangeLog	2016-09-21 17:44:43 UTC (rev 206217)
+++ trunk/Tools/ChangeLog	2016-09-21 18:00:19 UTC (rev 206218)
@@ -1,3 +1,13 @@
+2016-09-21  Alex Christensen  <achristen...@webkit.org>
+
+        URLParser: correctly parse relative URLs that are just one character
+        https://bugs.webkit.org/show_bug.cgi?id=162344
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2016-09-20  Alex Christensen  <achristen...@webkit.org>
 
         Optimize URLParser

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206217 => 206218)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-21 17:44:43 UTC (rev 206217)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-21 18:00:19 UTC (rev 206218)
@@ -296,6 +296,12 @@
     checkRelativeURL("notspecial:", "about:blank", {"notspecial", "", "", "", 0, "", "", "", "notspecial:"});
     checkRelativeURL("notspecial:", "http://host", {"notspecial", "", "", "", 0, "", "", "", "notspecial:"});
     checkRelativeURL("http:", "http://host", {"http", "", "", "host", 0, "/", "", "", "http://host/"});
+    checkRelativeURL("i", "sc:/pa/po", {"sc", "", "", "", 0, "/pa/i", "", "", "sc:/pa/i"});
+    checkRelativeURL("i    ", "sc:/pa/po", {"sc", "", "", "", 0, "/pa/i", "", "", "sc:/pa/i"});
+    checkRelativeURL("i\t\n  ", "sc:/pa/po", {"sc", "", "", "", 0, "/pa/i", "", "", "sc:/pa/i"});
+    checkRelativeURL("i", "sc://ho/pa", {"sc", "", "", "ho", 0, "/i", "", "", "sc://ho/i"});
+    checkRelativeURL("!", "sc://ho/pa", {"sc", "", "", "ho", 0, "/!", "", "", "sc://ho/!"});
+    checkRelativeURL("!", "sc:/ho/pa", {"sc", "", "", "", 0, "/ho/!", "", "", "sc:/ho/!"});
     
     // The checking of slashes in SpecialAuthoritySlashes needed to get this to pass contradicts what is in the spec,
     // but it is included in the web platform tests.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to