Title: [206235] trunk
Revision
206235
Author
achristen...@apple.com
Date
2016-09-21 14:16:15 -0700 (Wed, 21 Sep 2016)

Log Message

URLParser should match URL::parse when parsing data urls with slashes in them
https://bugs.webkit.org/show_bug.cgi?id=162352

Reviewed by Darin Adler.

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 (206234 => 206235)


--- trunk/Source/WebCore/ChangeLog	2016-09-21 20:53:49 UTC (rev 206234)
+++ trunk/Source/WebCore/ChangeLog	2016-09-21 21:16:15 UTC (rev 206235)
@@ -1,3 +1,15 @@
+2016-09-21  Alex Christensen  <achristen...@webkit.org>
+
+        URLParser should match URL::parse when parsing data urls with slashes in them
+        https://bugs.webkit.org/show_bug.cgi?id=162352
+
+        Reviewed by Darin Adler.
+
+        Covered by new API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parse):
+
 2016-09-21  Per Arne Vollan  <pvol...@apple.com>
 
         [Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().

Modified: trunk/Source/WebCore/platform/URLParser.cpp (206234 => 206235)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-09-21 20:53:49 UTC (rev 206234)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-09-21 21:16:15 UTC (rev 206235)
@@ -1430,6 +1430,10 @@
                 m_url.m_pathEnd = m_asciiBuffer.size();
                 m_url.m_queryEnd = m_url.m_pathEnd;
                 state = State::Fragment;
+            } else if (*c == '/') {
+                m_asciiBuffer.append('/');
+                m_url.m_pathAfterLastSlash = m_asciiBuffer.size();
+                ++c;
             } else {
                 utf8PercentEncode<serialized>(*c, m_asciiBuffer, isInSimpleEncodeSet);
                 ++c;

Modified: trunk/Tools/ChangeLog (206234 => 206235)


--- trunk/Tools/ChangeLog	2016-09-21 20:53:49 UTC (rev 206234)
+++ trunk/Tools/ChangeLog	2016-09-21 21:16:15 UTC (rev 206235)
@@ -1,5 +1,15 @@
 2016-09-21  Alex Christensen  <achristen...@webkit.org>
 
+        URLParser should match URL::parse when parsing data urls with slashes in them
+        https://bugs.webkit.org/show_bug.cgi?id=162352
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
+2016-09-21  Alex Christensen  <achristen...@webkit.org>
+
         URLParser should fail when parsing invalid relative URLs with no schemes
         https://bugs.webkit.org/show_bug.cgi?id=162355
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206234 => 206235)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-21 20:53:49 UTC (rev 206234)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-21 21:16:15 UTC (rev 206235)
@@ -220,6 +220,8 @@
     checkURL("notspecial:/a", {"notspecial", "", "", "", 0, "/a", "", "", "notspecial:/a"});
     checkURL("notspecial:", {"notspecial", "", "", "", 0, "", "", "", "notspecial:"});
     checkURL("notspecial:/", {"notspecial", "", "", "", 0, "/", "", "", "notspecial:/"});
+    checkURL("data:image/png;base64,encoded-data-follows-here", {"data", "", "", "", 0, "image/png;base64,encoded-data-follows-here", "", "", "data:image/png;base64,encoded-data-follows-here"});
+    checkURL("data:image/png;base64,encoded/data-with-slash", {"data", "", "", "", 0, "image/png;base64,encoded/data-with-slash", "", "", "data:image/png;base64,encoded/data-with-slash"});
 
     // This disagrees with the web platform test for http://:@www.example.com but agrees with Chrome and URL::parse,
     // and Firefox fails the web platform test differently. Maybe the web platform test ought to be changed.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to