Changeset 214944 in webkit
- Timestamp:
- Apr 5, 2017 6:36:47 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 21 added
- 17 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r214660 r214944 1 2017-04-05 Chris Dumez <cdumez@apple.com> 2 3 _blank / _self / _parent / _top browsing context names should be case-insensitive 4 https://bugs.webkit.org/show_bug.cgi?id=169747 5 6 Reviewed by Alex Christensen. 7 8 Import test coverage from upstream web-platform-tests. 9 10 * resources/import-expectations.json: 11 * web-platform-tests/html/browsers/windows/browsing-context-names/001.html: 12 * web-platform-tests/html/browsers/windows/browsing-context-names/002.html: 13 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank-expected.txt: Added. 14 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html: Added. 15 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html: 16 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001-expected.txt: Added. 17 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html: Added. 18 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002-expected.txt: Added. 19 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html: Added. 20 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003-expected.txt: Added. 21 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html: Added. 22 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004-expected.txt: Added. 23 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html: Added. 24 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html: 25 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html: 26 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name-expected.txt: 27 * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html: 28 * web-platform-tests/html/browsers/windows/browsing-context-names/existing.html: 29 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-1.html: Added. 30 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html. 31 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-3.html: Added. 32 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-1.html: Added. 33 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-2.html: Added. 34 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-nested.html: Added. 35 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-replace.html: Added. 36 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top.html: Added. 37 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html: Added. 38 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top-or-close.html: Added. 39 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html: Added. 40 * web-platform-tests/html/browsers/windows/browsing-context-names/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log. 41 * web-platform-tests/html/browsers/windows/browsing-context-names/self1.html: 42 * web-platform-tests/html/browsers/windows/browsing-context-names/self2.html: 43 * web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log: 44 1 45 2017-03-31 Manuel Rego Casasnovas <rego@igalia.com> 2 46 -
trunk/LayoutTests/imported/w3c/resources/import-expectations.json
r214660 r214944 200 200 "web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/": "import", 201 201 "web-platform-tests/html/browsers/windows/browsing-context-first-created.xhtml": "skip", 202 "web-platform-tests/html/browsers/windows/browsing-context-names": "import", 202 203 "web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement.html": "skip", 203 204 "web-platform-tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html": "skip", -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/001.html
r204844 r214944 1 1 <!doctype html> 2 2 <title>Link with target=_blank, rel=noreferrer</title> 3 <script src=" /resources/testharness.js"></script>4 <script src=" /resources/testharnessreport.js"></script>3 <script src="../../../../../../../resources/testharness.js"></script> 4 <script src="../../../../../../../resources/testharnessreport.js"></script> 5 5 <div id="log"></div> 6 6 <a href="001-1.html" rel="noreferrer" target="_blank">Link</a> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/002.html
r204844 r214944 1 1 <!doctype html> 2 2 <title>Link with target=_blank, no rel</title> 3 <script src=" /resources/testharness.js"></script>4 <script src=" /resources/testharnessreport.js"></script>3 <script src="../../../../../../../resources/testharness.js"></script> 4 <script src="../../../../../../../resources/testharnessreport.js"></script> 5 5 <div id="log"></div> 6 6 <a href="002-1.html" target="_blank">Link</a> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html
r204844 r214944 3 3 <title>HTML Test: Choose browsing context - the given name is same as an existing browsing context's name</title> 4 4 <link rel="author" title="Intel" href="http://www.intel.com/"> 5 <script src=" /resources/testharness.js"></script>6 <script src=" /resources/testharnessreport.js"></script>5 <script src="../../../../../../../resources/testharness.js"></script> 6 <script src="../../../../../../../resources/testharnessreport.js"></script> 7 7 <div id="log"></div> 8 8 <iframe src="existing.html" style="display:none"></iframe> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html
r204844 r214944 3 3 <title>HTML Test: Choose browsing context - the given name is '_self'</title> 4 4 <link rel="author" title="Intel" href="http://www.intel.com/"> 5 <script src=" /resources/testharness.js"></script>6 <script src=" /resources/testharnessreport.js"></script>5 <script src="../../../../../../../resources/testharness.js"></script> 6 <script src="../../../../../../../resources/testharnessreport.js"></script> 7 7 <div id="log"></div> 8 8 <iframe src="self1.html" style="display:none"></iframe> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html
r204844 r214944 3 3 <title>HTML Test: Choose browsing context - the given name is empty string</title> 4 4 <link rel="author" title="Intel" href="http://www.intel.com/"> 5 <script src=" /resources/testharness.js"></script>6 <script src=" /resources/testharnessreport.js"></script>5 <script src="../../../../../../../resources/testharness.js"></script> 6 <script src="../../../../../../../resources/testharnessreport.js"></script> 7 7 <div id="log"></div> 8 8 <iframe src="self2.html" style="display:none"></iframe> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name-expected.txt
r204844 r214944 1 1 2 PASS A embedded browsing context has nodefault name3 PASS A browsing context which is opened by window.open() method with '_blank' parameter has nodefault name4 PASS A browsing context has nodefault name5 2 PASS A embedded browsing context has empty-string default name 3 PASS A browsing context which is opened by window.open() method with '_blank' parameter has empty-string default name 4 PASS A browsing context has an empty-string default name 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html
r204844 r214944 3 3 <title>HTML Test: Browsing context - Default name</title> 4 4 <link rel="author" title="Intel" href="http://www.intel.com/"> 5 <script src=" /resources/testharness.js"></script>6 <script src=" /resources/testharnessreport.js"></script>5 <script src="../../../../../../../resources/testharness.js"></script> 6 <script src="../../../../../../../resources/testharnessreport.js"></script> 7 7 <div id="log"></div> 8 <iframe src="message.html" style="display:none"></iframe> 8 <iframe src="/common/blank.html" style="display:none"></iframe> 9 <object id="obj" type="text/html" data="about:blank"></object> 10 <embed id="embedded" type="image/svg+xml" src="/images/green.svg" width="0" height="0" /> 9 11 <script> 12 test(t => { 13 assert_equals(window.frames[0].name, ""); 14 assert_equals(document.getElementById("embedded").name, ""); 15 assert_equals(window["obj"].name, ""); 16 }, "A embedded browsing context has empty-string default name"); 10 17 11 test(function () { 12 assert_equals(window.frames[0].name, "", "The browsing context should not have a default name."); 13 }, "A embedded browsing context has no default name"); 14 15 test(function () { 18 test(t => { 16 19 var win = window.open("about:blank", "_blank"); 17 assert_equals(win.name, "" , "The browsing context should not have a name.");20 assert_equals(win.name, ""); 18 21 win.close(); 19 }, "A browsing context which is opened by window.open() method with '_blank' parameter has nodefault name");22 }, "A browsing context which is opened by window.open() method with '_blank' parameter has empty-string default name"); 20 23 21 24 //This test must be run when the current browsing context's name is not set 22 test( function (){23 assert_equals(window.name, "" , "The browsing context should not have a name.");24 }, "A browsing context has nodefault name");25 test(t => { 26 assert_equals(window.name, ""); 27 }, "A browsing context has an empty-string default name"); 25 28 26 29 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html
r204844 r214944 6 6 7 7 function do_test() { 8 window.open(" message.html", "existWin");8 window.open("resources/post-to-top.html", "existWin"); 9 9 } 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html
r214943 r214944 1 1 <!DOCTYPE html> 2 2 <meta charset="utf-8"> 3 <title> This is a test page</title>3 <title>HTML Test: browsing context name - parent</title> 4 4 <link rel="author" title="Intel" href="http://www.intel.com/"> 5 5 <script> 6 6 7 function do_test() { 8 window.open("message.html", "existWin"); 9 } 7 window.open("post-to-top.html", "_parent"); 10 8 11 9 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/w3c-import.log
r214943 r214944 16 16 ------------------------------------------------------------------------ 17 17 List of files: 18 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/001-1.html 19 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/001.html 20 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html 21 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/002.html 22 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html 23 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html 24 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html 25 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html 26 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html 27 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html 28 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/message.html 29 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/parent1.html 30 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/parent2.html 31 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self1.html 32 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self2.html 18 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-1.html 19 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html 20 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-3.html 21 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-1.html 22 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-2.html 23 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-nested.html 24 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-replace.html 25 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top.html 26 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html 27 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top-or-close.html 28 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self1.html
r204844 r214944 6 6 7 7 window.name = "selfWin1"; 8 var win = window.open(" message.html", "_self");8 var win = window.open("resources/post-to-top.html", "_self"); 9 9 win.close(); 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self2.html
r204844 r214944 6 6 7 7 window.name = "selfWin2"; 8 var win = window.open(" message.html", "");8 var win = window.open("resources/post-to-top.html", ""); 9 9 win.close(); 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log
r212202 r214944 20 20 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html 21 21 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/002.html 22 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html 22 23 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html 23 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html 24 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html 25 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html 26 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html 27 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html 24 28 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html 25 29 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html 26 30 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html 27 31 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html 28 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/message.html29 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/parent1.html30 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/parent2.html31 32 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self1.html 32 33 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/self2.html -
trunk/Source/WebCore/ChangeLog
r214939 r214944 1 2017-04-05 Chris Dumez <cdumez@apple.com> 2 3 _blank / _self / _parent / _top browsing context names should be case-insensitive 4 https://bugs.webkit.org/show_bug.cgi?id=169747 5 6 Reviewed by Alex Christensen. 7 8 _blank / _self / _parent / _top browsing context names should be case-insensitive 9 as per the HTML specification: 10 - https://html.spec.whatwg.org/#browsing-context-names 11 12 This aligns our behavior with Firefox as well. See discussion at: 13 - https://github.com/whatwg/html/issues/2443 14 15 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html 16 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html 17 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html 18 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html 19 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html 20 21 * loader/FrameLoader.cpp: 22 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): 23 (WebCore::createWindow): 24 * page/DOMWindow.cpp: 25 (WebCore::DOMWindow::open): 26 * page/FrameTree.cpp: 27 (WebCore::FrameTree::uniqueChildName): 28 (WebCore::FrameTree::find): 29 1 30 2017-04-05 Miguel Gomez <magomez@igalia.com> 2 31 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r214900 r214944 3199 3199 mainFrame->loader().forceSandboxFlags(frame->loader().effectiveSandboxFlags()); 3200 3200 3201 if ( frameName != "_blank")3201 if (!equalIgnoringASCIICase(frameName, "_blank")) 3202 3202 mainFrame->tree().setName(frameName); 3203 3203 … … 3705 3705 created = false; 3706 3706 3707 if (!request.frameName().isEmpty() && request.frameName() != "_blank") {3707 if (!request.frameName().isEmpty() && !equalIgnoringASCIICase(request.frameName(), "_blank")) { 3708 3708 if (RefPtr<Frame> frame = lookupFrame.loader().findFrameForNavigation(request.frameName(), openerFrame.document())) { 3709 if ( request.frameName() != "_self") {3709 if (!equalIgnoringASCIICase(request.frameName(), "_self")) { 3710 3710 if (Page* page = frame->page()) 3711 3711 page->chrome().focus(); … … 3743 3743 frame->loader().forceSandboxFlags(openerFrame.document()->sandboxFlags()); 3744 3744 3745 if ( request.frameName() != "_blank")3745 if (!equalIgnoringASCIICase(request.frameName(), "_blank")) 3746 3746 frame->tree().setName(request.frameName()); 3747 3747 -
trunk/Source/WebCore/page/DOMWindow.cpp
r214703 r214944 2264 2264 // In those cases, we schedule a location change right now and return early. 2265 2265 Frame* targetFrame = nullptr; 2266 if ( frameName == "_top")2266 if (equalIgnoringASCIICase(frameName, "_top")) 2267 2267 targetFrame = &m_frame->tree().top(); 2268 else if ( frameName == "_parent") {2268 else if (equalIgnoringASCIICase(frameName, "_parent")) { 2269 2269 if (Frame* parent = m_frame->tree().parent()) 2270 2270 targetFrame = parent; -
trunk/Source/WebCore/page/FrameTree.cpp
r214893 r214944 110 110 { 111 111 // If the requested name (the frame's "name" attribute) is unique, just use that. 112 if (!requestedName.isEmpty() && !child(requestedName) && requestedName != "_blank")112 if (!requestedName.isEmpty() && !child(requestedName) && !equalIgnoringASCIICase(requestedName, "_blank")) 113 113 return requestedName; 114 114 … … 252 252 Frame* FrameTree::find(const AtomicString& name) const 253 253 { 254 if (name == "_self" || name == "_current" || name.isEmpty()) 254 // FIXME: _current is not part of the HTML specification. 255 if (equalIgnoringASCIICase(name, "_self") || name == "_current" || name.isEmpty()) 255 256 return &m_thisFrame; 256 257 257 if ( name == "_top")258 if (equalIgnoringASCIICase(name, "_top")) 258 259 return &top(); 259 260 260 if ( name == "_parent")261 if (equalIgnoringASCIICase(name, "_parent")) 261 262 return parent() ? parent() : &m_thisFrame; 262 263 263 264 // Since "_blank" should never be any frame's name, the following is only an optimization. 264 if ( name == "_blank")265 if (equalIgnoringASCIICase(name, "_blank")) 265 266 return nullptr; 266 267
Note: See TracChangeset
for help on using the changeset viewer.