Title: [199199] trunk
Revision
199199
Author
[email protected]
Date
2016-04-07 15:44:37 -0700 (Thu, 07 Apr 2016)

Log Message

fast/loader/opaque-base-url.html crashing during mac and ios debug tests
https://bugs.webkit.org/show_bug.cgi?id=156179
<rdar://problem/25507719>

Reviewed by Andy Estes.

Source/WebCore:

A relative URL other than "#" with a non-hierarchical base is invalid, but prior to this
change the URL's string would still contain the invalid relative URL. To avoid mistakes
where we might later treat this URL string as a parsed URL string, set the string to
"about:blank" instead.

Test: fast/url/data-uri-based-urls.html

* platform/URL.cpp:
(WebCore::URL::init):

LayoutTests:

* TestExpectations:
* fast/url/data-uri-based-urls-expected.txt: Added.
* fast/url/data-uri-based-urls.html: Added.
* fast/url/relative-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199198 => 199199)


--- trunk/LayoutTests/ChangeLog	2016-04-07 22:35:30 UTC (rev 199198)
+++ trunk/LayoutTests/ChangeLog	2016-04-07 22:44:37 UTC (rev 199199)
@@ -1,3 +1,16 @@
+2016-04-07  Jiewen Tan  <[email protected]>
+
+        fast/loader/opaque-base-url.html crashing during mac and ios debug tests
+        https://bugs.webkit.org/show_bug.cgi?id=156179
+        <rdar://problem/25507719>
+
+        Reviewed by Andy Estes.
+
+        * TestExpectations:
+        * fast/url/data-uri-based-urls-expected.txt: Added.
+        * fast/url/data-uri-based-urls.html: Added.
+        * fast/url/relative-expected.txt:
+
 2016-04-07  Ada Chan  <[email protected]>
 
         Skip a couple more tests that are asserting in FrameView::scheduleRelayoutOfSubtree().

Modified: trunk/LayoutTests/TestExpectations (199198 => 199199)


--- trunk/LayoutTests/TestExpectations	2016-04-07 22:35:30 UTC (rev 199198)
+++ trunk/LayoutTests/TestExpectations	2016-04-07 22:44:37 UTC (rev 199199)
@@ -905,8 +905,6 @@
 imported/blink/fast/multicol/outlines-at-column-boundaries.html [ ImageOnlyFailure ]
 fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ]
 
-webkit.org/b/156179 [ Debug ] fast/loader/opaque-base-url.html [ Skip ]
-
 # Assertion failure in MessagePort::contextDestroyed, usually attributed to later tests
 webkit.org/b/94458 http/tests/security/MessagePort/event-listener-context.html [ Skip ]
 

Added: trunk/LayoutTests/fast/url/data-uri-based-urls-expected.txt (0 => 199199)


--- trunk/LayoutTests/fast/url/data-uri-based-urls-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/url/data-uri-based-urls-expected.txt	2016-04-07 22:44:37 UTC (rev 199199)
@@ -0,0 +1,20 @@
+Test passes if i) the first iframe which includes a relative URL prints about:blank, ii) the second one which includes an absolute URL prints http://www.example.com, and iii) the third one which includes a fragment does not print about:blank
+
+   
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+about:blank
+
+
+--------
+Frame: '<!--framePath //<!--frame1-->-->'
+--------
+http://www.example.com/
+
+
+--------
+Frame: '<!--framePath //<!--frame2-->-->'
+--------
+data:text/html,

Added: trunk/LayoutTests/fast/url/data-uri-based-urls.html (0 => 199199)


--- trunk/LayoutTests/fast/url/data-uri-based-urls.html	                        (rev 0)
+++ trunk/LayoutTests/fast/url/data-uri-based-urls.html	2016-04-07 22:44:37 UTC (rev 199199)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.dumpChildFramesAsText();
+    }
+</script>
+</head>
+<body>
+<p>Test passes if i) the first iframe which includes a relative URL prints about:blank, ii) the second one which includes an absolute URL prints http://www.example.com, and iii) the third one which includes a fragment does not print about:blank</p>
+
+<iframe src=''></iframe>
+
+<iframe src=''></iframe>
+
+<iframe src=''></iframe>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/url/relative-expected.txt (199198 => 199199)


--- trunk/LayoutTests/fast/url/relative-expected.txt	2016-04-07 22:35:30 UTC (rev 199198)
+++ trunk/LayoutTests/fast/url/relative-expected.txt	2016-04-07 22:44:37 UTC (rev 199199)
@@ -38,7 +38,7 @@
 PASS canonicalize('#ref') is 'http://host/a#ref'
 PASS canonicalize('#') is 'http://host/a#'
 PASS canonicalize('#bye') is 'http://host/a?foo=bar#bye'
-FAIL canonicalize('baz.html') should be . Was baz.html.
+FAIL canonicalize('baz.html') should be . Was about:blank.
 PASS canonicalize('data:baz') is 'data:baz'
 PASS canonicalize('data:/base') is 'data:/base'
 PASS canonicalize('http://host/') is 'http://host/'
@@ -46,7 +46,7 @@
 PASS canonicalize('./asd:fgh') is 'http://foo/asd:fgh'
 PASS canonicalize(':foo') is 'http://foo/:foo'
 PASS canonicalize(' hello world') is 'http://foo/hello%20world'
-FAIL canonicalize(':foo') should be . Was :foo.
+FAIL canonicalize(':foo') should be . Was about:blank.
 PASS canonicalize(';foo') is 'http://host/;foo'
 PASS canonicalize(';foo') is 'http://host/;foo'
 PASS canonicalize(';/../bar') is 'http://host/bar'

Modified: trunk/Source/WebCore/ChangeLog (199198 => 199199)


--- trunk/Source/WebCore/ChangeLog	2016-04-07 22:35:30 UTC (rev 199198)
+++ trunk/Source/WebCore/ChangeLog	2016-04-07 22:44:37 UTC (rev 199199)
@@ -1,3 +1,21 @@
+2016-04-07  Jiewen Tan  <[email protected]>
+
+        fast/loader/opaque-base-url.html crashing during mac and ios debug tests
+        https://bugs.webkit.org/show_bug.cgi?id=156179
+        <rdar://problem/25507719>
+
+        Reviewed by Andy Estes.
+
+        A relative URL other than "#" with a non-hierarchical base is invalid, but prior to this
+        change the URL's string would still contain the invalid relative URL. To avoid mistakes
+        where we might later treat this URL string as a parsed URL string, set the string to
+        "about:blank" instead.
+
+        Test: fast/url/data-uri-based-urls.html
+
+        * platform/URL.cpp:
+        (WebCore::URL::init):
+
 2016-04-07  Brian Burg  <[email protected]>
 
         Web Automation: implement Automation.addSingleCookie

Modified: trunk/Source/WebCore/platform/URL.cpp (199198 => 199199)


--- trunk/Source/WebCore/platform/URL.cpp	2016-04-07 22:35:30 UTC (rev 199198)
+++ trunk/Source/WebCore/platform/URL.cpp	2016-04-07 22:44:37 UTC (rev 199199)
@@ -491,6 +491,8 @@
         str = strBuffer.data();
     } else {
         if (!encodeRelativeString(rel, encoding, strBuffer)) {
+            // FIXME: Instead of assigning the m_string to blankURL(), we should
+            // figure out a proper way to preserve the original malformed URL strings.
             m_string = blankURL();
             invalidate();
             return;
@@ -542,7 +544,9 @@
                 appendASCII(base.m_string.left(base.m_queryEnd), str, len, parseBuffer);
                 parse(parseBuffer.data(), &relative);
             } else {
-                m_string = relative;
+                // FIXME: Instead of assigning the m_string to blankURL(), we should
+                // figure out a proper way to preserve the original malformed URL strings.
+                m_string = blankURL();
                 invalidate();
             }
             return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to