Changeset 280491 in webkit
- Timestamp:
- Jul 30, 2021 1:25:46 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 15 edited
- 5 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Window/open-invalid-url.html (modified) (1 diff)
-
LayoutTests/http/tests/dom/iframe-no-src-local-origin-allow-expected.txt (moved) (moved from trunk/LayoutTests/fast/frames/iframe-no-src-local-origin-allow-expected.txt) (1 diff)
-
LayoutTests/http/tests/dom/iframe-no-src-local-origin-allow.html (moved) (moved from trunk/LayoutTests/fast/frames/iframe-no-src-local-origin-allow.html) (3 diffs)
-
LayoutTests/http/tests/dom/iframe-no-src-set-location-expected.txt (moved) (moved from trunk/LayoutTests/fast/frames/iframe-no-src-set-location-expected.txt) (1 diff)
-
LayoutTests/http/tests/dom/iframe-no-src-set-location.html (moved) (moved from trunk/LayoutTests/fast/frames/iframe-no-src-set-location.html) (4 diffs)
-
LayoutTests/http/tests/dom/resources/iframe-no-src-set-location-pass.html (moved) (moved from trunk/LayoutTests/fast/frames/resources/iframe-no-src-set-location-pass.html)
-
LayoutTests/http/tests/security/aboutBlank/security-context-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-lexical-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-write-lexical-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-writeln-lexical-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-window-open-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-with-base-tag-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-write-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/aboutBlank/security-context-writeln-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/urls/terminology-0/document-base-url-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280482 r280491 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Document's fallback base URL should be deduced from its creator when URL is about:blank 4 https://bugs.webkit.org/show_bug.cgi?id=228624 5 6 Reviewed by Geoffrey Garen. 7 8 Update existing tests to reflect behavior change. I have verified that those tests were failing in Firefox & Chrome and 9 are now passing in those browsers. 10 11 * http/tests/dom/iframe-no-src-local-origin-allow-expected.txt: Renamed from LayoutTests/fast/frames/iframe-no-src-local-origin-allow-expected.txt. 12 * http/tests/dom/iframe-no-src-local-origin-allow.html: Renamed from LayoutTests/fast/frames/iframe-no-src-local-origin-allow.html. 13 * http/tests/dom/iframe-no-src-set-location-expected.txt: Renamed from LayoutTests/fast/frames/iframe-no-src-set-location-expected.txt. 14 * http/tests/dom/iframe-no-src-set-location.html: Renamed from LayoutTests/fast/frames/iframe-no-src-set-location.html. 15 * http/tests/dom/resources/iframe-no-src-set-location-pass.html: Renamed from LayoutTests/fast/frames/resources/iframe-no-src-set-location-pass.html. 16 * http/tests/security/aboutBlank/security-context-expected.txt: 17 * http/tests/security/aboutBlank/security-context-grandchildren-expected.txt: 18 * http/tests/security/aboutBlank/security-context-grandchildren-lexical-expected.txt: 19 * http/tests/security/aboutBlank/security-context-grandchildren-write-lexical-expected.txt: 20 * http/tests/security/aboutBlank/security-context-grandchildren-writeln-lexical-expected.txt: 21 * http/tests/security/aboutBlank/security-context-window-open-expected.txt: 22 * http/tests/security/aboutBlank/security-context-with-base-tag-expected.txt: 23 * http/tests/security/aboutBlank/security-context-write-expected.txt: 24 * http/tests/security/aboutBlank/security-context-writeln-expected.txt: 25 1 26 2021-07-30 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/LayoutTests/fast/dom/Window/open-invalid-url.html
r235050 r280491 12 12 var a = window.open("about:blank","moonshine") 13 13 function mountainGoat() { 14 a.window.eval('setTimeout("try { window.open(\' /\'); alert(\'FAIL\'); } catch(ex) { alert(\'PASS\'); }; if (window.testRunner) testRunner.notifyDone()", 0)')14 a.window.eval('setTimeout("try { window.open(\'http://invalid:url\'); alert(\'FAIL\'); } catch(ex) { alert(\'PASS\'); }; if (window.testRunner) testRunner.notifyDone()", 0)') 15 15 } 16 16 setTimeout("mountainGoat()", 0) -
trunk/LayoutTests/http/tests/dom/iframe-no-src-local-origin-allow-expected.txt
r280490 r280491 4 4 5 5 6 PASS document.getElementById('theFrame').contentDocument.baseURI is 'about:blank'6 PASS document.getElementById('theFrame').contentDocument.baseURI is "http://127.0.0.1:8000/dom/iframe-no-src-local-origin-allow.html" 7 7 PASS document.getElementById('theFrame').contentDocument.getElementById('innerFrame').contentDocument.body.innerHTML is 'PASS\n' 8 8 PASS successfullyParsed is true -
trunk/LayoutTests/http/tests/dom/iframe-no-src-local-origin-allow.html
r280490 r280491 1 1 <html> 2 2 <head> 3 <script src=" ../../resources/js-test-pre.js"></script>3 <script src="/js-test-resources/js-test.js"></script> 4 4 <script> 5 if (window.testRunner) {6 testRunner.dumpAsText();7 testRunner.waitUntilDone();8 }9 10 5 var iframeHasLoadedFirstPage = false; 11 6 12 7 function runTest() 13 8 { 14 shouldBe ("document.getElementById('theFrame').contentDocument.baseURI", "'about:blank'");9 shouldBeEqualToString("document.getElementById('theFrame').contentDocument.baseURI", "http://127.0.0.1:8000/dom/iframe-no-src-local-origin-allow.html"); 15 10 var frameDoc = document.getElementById('theFrame').contentWindow.document; 16 11 var innerFrame = frameDoc.createElement("iframe"); … … 19 14 innerFrame.onload = function() { 20 15 shouldBe("document.getElementById('theFrame').contentDocument.getElementById('innerFrame').contentDocument.body.innerHTML", "'PASS\\n'"); 21 isSuccessfullyParsed(); 22 if (window.testRunner) 23 testRunner.notifyDone(); 16 finishJSTest(); 24 17 } 25 18 frameDoc.body.appendChild(innerFrame); … … 31 24 <script> 32 25 description("This tests that an iframe with no src attribute uses the parent document's origin when resolving links inserted into the frame via JavaScript."); 26 jsTestIsAsync = true; 33 27 </script> 34 28 <iframe id="theFrame" onload="runTest()"></iframe> -
trunk/LayoutTests/http/tests/dom/iframe-no-src-set-location-expected.txt
r280490 r280491 4 4 5 5 6 PASS document.getElementById('theFrame').contentDocument.baseURI is 'about:blank'6 PASS document.getElementById('theFrame').contentDocument.baseURI is "http://127.0.0.1:8000/dom/iframe-no-src-set-location.html" 7 7 PASS document.getElementById('theFrame').contentDocument.body.innerHTML is 'PASS\n' 8 8 PASS successfullyParsed is true -
trunk/LayoutTests/http/tests/dom/iframe-no-src-set-location.html
r280490 r280491 1 1 <html> 2 2 <head> 3 <script src=" ../../resources/js-test-pre.js"></script>3 <script src="/js-test-resources/js-test.js"></script> 4 4 <script> 5 if (window.testRunner) {6 testRunner.dumpAsText();7 testRunner.waitUntilDone();8 }9 10 5 var iframeHasLoadedFirstPage = false; 11 6 … … 15 10 iframeHasLoadedFirstPage = true; 16 11 17 shouldBe ("document.getElementById('theFrame').contentDocument.baseURI", "'about:blank'");12 shouldBeEqualToString("document.getElementById('theFrame').contentDocument.baseURI", "http://127.0.0.1:8000/dom/iframe-no-src-set-location.html"); 18 13 var iframe = document.getElementById('theFrame'); 19 14 iframe.src = "javascript:document.location.replace('./resources/iframe-no-src-set-location-pass.html')"; … … 21 16 shouldBe("document.getElementById('theFrame').contentDocument.body.innerHTML", "'PASS\\n'"); 22 17 23 isSuccessfullyParsed(); 24 25 if (window.testRunner) { 26 testRunner.notifyDone(); 27 } 18 finishJSTest(); 28 19 } 29 20 } … … 34 25 <script> 35 26 description("This tests that an iframe with no src attribute uses the parent document's URL as a base when resolving non-fully-qualified URLs set by JavaScript."); 27 jsTestIsAsync = true; 36 28 </script> 37 29 <iframe id="theFrame" onload="runTest()"></iframe> -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-expected.txt
r34506 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context.html 7 7 document.cookie = cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context.html 11 11 document.cookie = cookie=parent 12 12 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-expected.txt
r34506 r280491 3 3 * "about:blank" 4 4 document.URL = about:blank 5 document.baseURI = about:blank5 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 6 6 document.cookie = cookie=resources; cookie=parent 7 7 * "" 8 8 document.URL = about:blank 9 document.baseURI = about:blank9 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 10 10 document.cookie = cookie=resources; cookie=parent 11 11 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-lexical-expected.txt
r43604 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 7 7 document.cookie = cookie=resources; cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 11 11 document.cookie = cookie=resources; cookie=parent 12 12 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-write-lexical-expected.txt
r43604 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 7 7 document.cookie = cookie=resources; cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 11 11 document.cookie = cookie=resources; cookie=parent 12 12 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-writeln-lexical-expected.txt
r43604 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 7 7 document.cookie = cookie=resources; cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/resources/iframe-with-about-blank-children.html 11 11 document.cookie = cookie=resources; cookie=parent 12 12 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-window-open-expected.txt
r34506 r280491 2 2 * "about:blank" 3 3 document.URL = about:blank 4 document.baseURI = about:blank4 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-window-open.html 5 5 document.cookie = cookie=parent 6 6 * "" 7 7 document.URL = about:blank 8 document.baseURI = about:blank8 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-window-open.html 9 9 document.cookie = cookie=parent 10 10 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-with-base-tag-expected.txt
r34506 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://set-by-base.example.com/ 7 7 document.cookie = cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://set-by-base.example.com/ 11 11 document.cookie = cookie=parent 12 12 --- After document.open() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-write-expected.txt
r34506 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-write.html 7 7 document.cookie = cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-write.html 11 11 document.cookie = cookie=parent 12 12 --- After document.write() --- -
trunk/LayoutTests/http/tests/security/aboutBlank/security-context-writeln-expected.txt
r34506 r280491 4 4 * "about:blank" 5 5 document.URL = about:blank 6 document.baseURI = about:blank6 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-writeln.html 7 7 document.cookie = cookie=parent 8 8 * "" 9 9 document.URL = about:blank 10 document.baseURI = about:blank10 document.baseURI = http://127.0.0.1:8000/security/aboutBlank/security-context-writeln.html 11 11 document.cookie = cookie=parent 12 12 --- After document.writeln() --- -
trunk/LayoutTests/imported/w3c/ChangeLog
r280488 r280491 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Document's fallback base URL should be deduced from its creator when URL is about:blank 4 https://bugs.webkit.org/show_bug.cgi?id=228624 5 6 Reviewed by Geoffrey Garen. 7 8 Rebaseline WPT test now that one more check is passing. 9 10 * web-platform-tests/html/infrastructure/urls/terminology-0/document-base-url-expected.txt: 11 1 12 2021-07-30 Jer Noble <jer.noble@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/infrastructure/urls/terminology-0/document-base-url-expected.txt
r267646 r280491 2 2 PASS The document base URL of a document containing one or more base elements with href attributes is the frozen base URL of the first base element in the document that has an href attribute, in tree order. 3 3 PASS The fallback base URL of a document containing no base element is the document's address. 4 FAIL The fallback base URL of a document whose address is about:blank is the document base URL of the creator document. assert_equals: The document base URL should be the creator document's base URL. expected "http://localhost:8800/html/infrastructure/urls/terminology-0/document-base-url.html" but got "about:blank" 4 PASS The fallback base URL of a document whose address is about:blank is the document base URL of the creator document. 5 5 FAIL about:blank with a base element. assert_equals: img src should resolve correctly expected "http://localhost:8800/html/infrastructure/urls/terminology-0/sub/foo" but got "http://localhost:8800/html/infrastructure/urls/terminology-0/foo" 6 6 PASS The fallback base URL of an iframe srcdoc document is the document base URL of the document's browsing context's browsing context container's document. -
trunk/Source/WebCore/ChangeLog
r280488 r280491 1 2021-07-30 Chris Dumez <cdumez@apple.com> 2 3 Document's fallback base URL should be deduced from its creator when URL is about:blank 4 https://bugs.webkit.org/show_bug.cgi?id=228624 5 6 Reviewed by Geoffrey Garen. 7 8 Document's fallback base URL should be deduced from its creator when URL is about:blank: 9 - https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url 10 11 Chrome and Firefox match the specification here. 12 13 Tests: http/tests/dom/iframe-no-src-local-origin-allow.html 14 http/tests/dom/iframe-no-src-set-location.html 15 16 * dom/Document.cpp: 17 (WebCore::Document::updateBaseURL): 18 1 19 2021-07-30 Jer Noble <jer.noble@apple.com> 2 20 -
trunk/Source/WebCore/dom/Document.cpp
r280467 r280491 3407 3407 void Document::updateBaseURL() 3408 3408 { 3409 URL oldBaseURL = m_baseURL;3410 3409 // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HTML], the base URI is computed using 3411 3410 // first the value of the href attribute of the HTML BASE element if any, and the value of the documentURI attribute … … 3420 3419 // and DOM 3 Core does not specify how it should be resolved. 3421 3420 m_baseURL = URL({ }, documentURI()); 3421 3422 if (m_baseURL == aboutBlankURL()) { 3423 auto* creator = parentDocument(); 3424 if (!creator && frame() && frame()->loader().opener()) 3425 creator = frame()->loader().opener()->document(); 3426 if (creator) 3427 m_baseURL = creator->baseURL(); 3428 } 3422 3429 } 3423 3430
Note: See TracChangeset
for help on using the changeset viewer.