Changeset 231456 in webkit
- Timestamp:
- May 7, 2018 2:42:29 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r231453 r231456 1 2018-05-07 Chris Dumez <cdumez@apple.com> 2 3 Stop using an iframe's id as fallback if its name attribute is not set 4 https://bugs.webkit.org/show_bug.cgi?id=11388 5 6 Reviewed by Geoff Garen. 7 8 * fast/dom/Window/named-getter-frame-id-expected.txt: Added. 9 * fast/dom/Window/named-getter-frame-id.html: Added. 10 Add layout test coverage. 11 12 * fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt: 13 * fast/dom/Geolocation/srcdoc-watchPosition-expected.txt: 14 * fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html: 15 * fast/dom/Window/window-special-properties-expected.txt: 16 * fast/frames/iframe-no-name-expected.txt: 17 * fast/frames/iframe-no-name.html: 18 * fast/layers/prevent-hit-test-during-layout.html: 19 * fast/xmlhttprequest/xmlhttprequest-no-file-access-expected.txt: 20 * http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html: 21 * http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script-expected.txt: 22 * http/tests/security/cross-origin-reified-window-property-access.html: 23 * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-and-try-access-from-right-frame-expected.txt: 24 * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-but-try-access-from-wrong-frame-expected.txt: 25 * http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html: 26 * http/wpt/beacon/keepalive-after-navigation-expected.txt: 27 * http/wpt/cache-storage/cache-remove-twice.html: 28 Update some layout tests that relied on our old (non-standard) behavior. 29 1 30 2018-05-07 Youenn Fablet <youenn@apple.com> 2 31 -
trunk/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt
r231367 r231456 4 4 5 5 -------- 6 Frame: ' frame'6 Frame: '<!--frame1-->' 7 7 -------- 8 8 FAIL should have invoked error callback, but invoked success callback. -
trunk/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt
r231367 r231456 4 4 5 5 -------- 6 Frame: ' frame'6 Frame: '<!--frame1-->' 7 7 -------- 8 8 FAIL should have invoked error callback, but invoked success callback. -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html
r231367 r231456 15 15 16 16 function setupTopLevel() { 17 var scrollTarget = window.frames['target'].document.getElementById('might_scroll');17 var scrollTarget = iframeTarget.contentDocument.getElementById('might_scroll'); 18 18 19 window.frames['target'].window.registerAction(function () {19 iframeTarget.contentWindow.registerAction(function () { 20 20 iframeTarget.remove(); 21 21 setTimeout(finish, 0); 22 22 }); 23 23 24 window.frames['target'].window.run();24 iframeTarget.contentWindow.run(); 25 25 } 26 26 </script> -
trunk/LayoutTests/fast/dom/Window/window-special-properties-expected.txt
r231367 r231456 43 43 Iframe by name (unique): single WINDOW 44 44 Iframe by name (multiple): single WINDOW 45 Iframe by id (unique): single WINDOW46 Iframe by id (multiple): single WINDOW45 Iframe by id (unique): single IFRAME(id) 46 Iframe by id (multiple): collection(2) IFRAME(id) IFRAME(id) 47 47 Iframe by id/name mixed: single WINDOW 48 48 … … 54 54 Span by id/name mixed: collection(2) SPAN(id) SPAN(id) 55 55 56 Mixed by id: single WINDOW56 Mixed by id: collection(7) IMG(id) FORM(id) APPLET(id) EMBED(id) OBJECT(id) IFRAME(id) SPAN(id) 57 57 Mixed by name: single WINDOW 58 58 Mixed by id (no iframe): collection(6) IMG(id) FORM(id) APPLET(id) EMBED(id) OBJECT(id) SPAN(id) -
trunk/LayoutTests/fast/frames/iframe-no-name-expected.txt
r231367 r231456 4 4 5 5 6 PASS frames[0].name is " id"6 PASS frames[0].name is "" 7 7 PASS frames[1].name is "name" 8 8 PASS frames[2].name is "name" -
trunk/LayoutTests/fast/frames/iframe-no-name.html
r231367 r231456 12 12 <script> 13 13 description("Checks that the id of an iframe does not set the contentWindow's name if the iframe's name is not set."); 14 shouldBeEqualToString("frames[0].name", " id");14 shouldBeEqualToString("frames[0].name", ""); 15 15 shouldBeEqualToString("frames[1].name", "name"); 16 16 shouldBeEqualToString("frames[2].name", "name"); -
trunk/LayoutTests/fast/layers/prevent-hit-test-during-layout.html
r231367 r231456 34 34 35 35 function runTest() { 36 fixedDiv = window.frames['fixedFrame'].document.getElementById('fixedDiv');36 fixedDiv = fixedFrame.contentDocument.getElementById('fixedDiv'); 37 37 target = document.getElementById('target'); 38 38 -
trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-no-file-access-expected.txt
r231450 r231456 17 17 18 18 -------- 19 Frame: ' f'19 Frame: '<!--frame2-->' 20 20 -------- 21 21 Successful write into iframe -
trunk/LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt
r231367 r231456 1 1 main frame - didStartProvisionalLoadForFrame 2 2 main frame - didCommitLoadForFrame 3 frame " frame" - didStartProvisionalLoadForFrame3 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 4 4 main frame - didFinishDocumentLoadForFrame 5 5 http://127.0.0.1:8000/loading/resources/basic-auth-testing.php?username=webkit&password=rocks - didReceiveAuthenticationChallenge - Responding with webkit:rocks 6 frame " frame" - didCommitLoadForFrame7 frame " frame" - didFinishDocumentLoadForFrame8 frame " frame" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html9 frame " frame" - didHandleOnloadEventsForFrame6 frame "<!--frame1-->" - didCommitLoadForFrame 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 8 frame "<!--frame1-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html 9 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 10 10 main frame - didHandleOnloadEventsForFrame 11 frame " frame" - didFinishLoadForFrame11 frame "<!--frame1-->" - didFinishLoadForFrame 12 12 main frame - didFinishLoadForFrame 13 frame " frame" - didStartProvisionalLoadForFrame14 frame " frame" - didCancelClientRedirectForFrame15 frame " frame" - didCommitLoadForFrame16 frame " frame" - didReceiveTitle: 404 Not Found17 frame " frame" - didFinishDocumentLoadForFrame18 frame " frame" - didFailLoadWithError13 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 14 frame "<!--frame1-->" - didCancelClientRedirectForFrame 15 frame "<!--frame1-->" - didCommitLoadForFrame 16 frame "<!--frame1-->" - didReceiveTitle: 404 Not Found 17 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 18 frame "<!--frame1-->" - didFailLoadWithError 19 19 PASS did not cause assertion failure. -
trunk/LayoutTests/http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt
r231450 r231456 1 frame "<!--frame 1-->" - has 1 onunload handler(s)1 frame "<!--frame2-->" - has 1 onunload handler(s) 2 2 This test triggers an unload handler that starts an image load in a different frame (and deletes both frames), but ensures the main frame is not destroyed. We pass if we don't crash. -
trunk/LayoutTests/http/tests/quicklook/csp-header-ignored-expected.txt
r231367 r231456 5 5 6 6 -------- 7 Frame: ' frame'7 Frame: '<!--frame1-->' 8 8 -------- 9 9 PASS -
trunk/LayoutTests/http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
r231367 r231456 34 34 getSelection().removeAllRanges(); 35 35 setTimeout(() => { 36 destinationFrame. postMessage({type: 'paste'}, '*');36 destinationFrame.contentWindow.postMessage({type: 'paste'}, '*'); 37 37 }, 0); 38 38 } -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script-expected.txt
r231367 r231456 3 3 4 4 -------- 5 Frame: ' frame'5 Frame: '<!--frame1-->' 6 6 -------- 7 7 -
trunk/LayoutTests/http/tests/security/cross-origin-reified-window-property-access.html
r231367 r231456 27 27 function runTest() 28 28 { 29 crossOriginWindow = crossOriginFrame. window;30 sameOriginWindow = sameOriginFrame. window;29 crossOriginWindow = crossOriginFrame.contentWindow; 30 sameOriginWindow = sameOriginFrame.contentWindow; 31 31 32 32 shouldThrowOrReturnUndefined('crossOriginWindow.document'); -
trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-and-try-access-from-right-frame-expected.txt
r231450 r231456 11 11 12 12 -------- 13 Frame: ' TheIframeThatRequestsStorageAccess'13 Frame: '<!--frame1-->' 14 14 -------- 15 15 After the top frame navigates the sub frame, the sub frame should no longer have access to first-party cookies. … … 19 19 20 20 -------- 21 Frame: '<!--frame 1-->'21 Frame: '<!--frame2-->' 22 22 -------- 23 23 Should receive first-party cookie. … … 27 27 28 28 -------- 29 Frame: '<!--frame 2-->'29 Frame: '<!--frame3-->' 30 30 -------- 31 31 Should not receive cookies. … … 35 35 36 36 -------- 37 Frame: '<!--frame 3-->'37 Frame: '<!--frame4-->' 38 38 -------- 39 39 … … 41 41 42 42 -------- 43 Frame: '<!--frame 4-->'43 Frame: '<!--frame5-->' 44 44 -------- 45 45 Should receive partitioned cookie. -
trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-but-try-access-from-wrong-frame-expected.txt
r231450 r231456 11 11 12 12 -------- 13 Frame: ' theIframe'13 Frame: '<!--frame1-->' 14 14 -------- 15 15 16 16 17 17 -------- 18 Frame: '<!--frame 1-->'18 Frame: '<!--frame2-->' 19 19 -------- 20 20 Should receive first-party cookie. … … 24 24 25 25 -------- 26 Frame: '<!--frame 2-->'26 Frame: '<!--frame3-->' 27 27 -------- 28 28 Should not receive cookies. … … 32 32 33 33 -------- 34 Frame: '<!--frame 3-->'34 Frame: '<!--frame4-->' 35 35 -------- 36 36 37 37 38 39 --------40 Frame: '<!--frame4-->'41 --------42 Should receive partitioned cookie.43 Did not receive cookie named 'firstPartyCookie'.44 Received cookie named 'partitionedCookie'.45 Client-side document.cookie: partitionedCookie=value46 38 47 39 -------- … … 52 44 Received cookie named 'partitionedCookie'. 53 45 Client-side document.cookie: partitionedCookie=value 46 47 -------- 48 Frame: '<!--frame6-->' 49 -------- 50 Should receive partitioned cookie. 51 Did not receive cookie named 'firstPartyCookie'. 52 Received cookie named 'partitionedCookie'. 53 Client-side document.cookie: partitionedCookie=value -
trunk/LayoutTests/http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
r231367 r231456 16 16 if (event.data === "getUserMedia done") { 17 17 didGetUserMedia = true; 18 frame1. postMessage("check filtering", "*");18 frame1.contentWindow.postMessage("check filtering", "*"); 19 19 return; 20 20 } -
trunk/LayoutTests/http/wpt/beacon/keepalive-after-navigation-expected.txt
r231367 r231456 1 frame " testFrame" - has 1 onunload handler(s)1 frame "<!--frame1-->" - has 1 onunload handler(s) 2 2 3 3 PASS Test that beacon sent from unload event handler is properly received -
trunk/LayoutTests/http/wpt/cache-storage/cache-remove-twice.html
r231367 r231456 25 25 return new Promise((resolve, reject) => { 26 26 window.addEventListener("message", test.step_func((event) => { 27 return Promise.all([self.caches.open(cacheName), cacheFrame. window.caches.open(cacheName) ]).then(() => {28 return Promise.all([self.caches.delete(cacheName), cacheFrame. window.caches.delete(cacheName)]);27 return Promise.all([self.caches.open(cacheName), cacheFrame.contentWindow.caches.open(cacheName) ]).then(() => { 28 return Promise.all([self.caches.delete(cacheName), cacheFrame.contentWindow.caches.delete(cacheName)]); 29 29 }).then(resolve, reject); 30 30 })); -
trunk/LayoutTests/platform/ios/http/tests/quicklook/csp-header-ignored-expected.txt
r231367 r231456 4 4 5 5 -------- 6 Frame: ' frame'6 Frame: '<!--frame1-->' 7 7 -------- 8 8 PASS -
trunk/LayoutTests/platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt
r231367 r231456 2 2 main frame - didCommitLoadForFrame 3 3 main frame - didFinishDocumentLoadForFrame 4 frame " frame" - didStartProvisionalLoadForFrame4 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 5 5 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with webkit:rocks 6 frame " frame" - didCommitLoadForFrame7 frame " frame" - didFinishDocumentLoadForFrame8 frame " frame" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html9 frame " frame" - didHandleOnloadEventsForFrame6 frame "<!--frame1-->" - didCommitLoadForFrame 7 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 8 frame "<!--frame1-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/a//b/non-existent-file.html 9 frame "<!--frame1-->" - didHandleOnloadEventsForFrame 10 10 main frame - didHandleOnloadEventsForFrame 11 frame " frame" - didFinishLoadForFrame11 frame "<!--frame1-->" - didFinishLoadForFrame 12 12 main frame - didFinishLoadForFrame 13 frame " frame" - didStartProvisionalLoadForFrame14 frame " frame" - didCancelClientRedirectForFrame15 frame " frame" - didCommitLoadForFrame16 frame " frame" - didReceiveTitle: 404 Not Found17 frame " frame" - didFinishDocumentLoadForFrame18 frame " frame" - didFailLoadWithError13 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 14 frame "<!--frame1-->" - didCancelClientRedirectForFrame 15 frame "<!--frame1-->" - didCommitLoadForFrame 16 frame "<!--frame1-->" - didReceiveTitle: 404 Not Found 17 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 18 frame "<!--frame1-->" - didFailLoadWithError 19 19 PASS did not cause assertion failure. -
trunk/Source/WebCore/ChangeLog
r231450 r231456 1 2018-05-07 Chris Dumez <cdumez@apple.com> 2 3 Stop using an iframe's id as fallback if its name attribute is not set 4 https://bugs.webkit.org/show_bug.cgi?id=11388 5 6 Reviewed by Geoff Garen. 7 8 WebKit had logic to use an iframe's id as fallback name when its name 9 content attribute is not set. This behavior was not standard and did not 10 match other browsers: 11 - https://html.spec.whatwg.org/#attr-iframe-name 12 13 Gecko / Trident never behaved this way. Blink was aligned with us until 14 they started to match the specification in: 15 - https://bugs.chromium.org/p/chromium/issues/detail?id=347169 16 17 This WebKit quirk was causing some Web-compatibility issues because it 18 would affect the behavior of Window's name property getter when trying 19 to look up an iframe by id. Because of Window's named property getter 20 behavior [1], we would return the frame's contentWindow instead of the 21 iframe element itself. 22 23 [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object 24 25 Test: fast/dom/Window/named-getter-frame-id.html 26 27 * html/HTMLFrameElementBase.cpp: 28 (WebCore::HTMLFrameElementBase::openURL): 29 (WebCore::HTMLFrameElementBase::parseAttribute): 30 (WebCore::HTMLFrameElementBase::didFinishInsertingNode): 31 * html/HTMLFrameElementBase.h: 32 1 33 2018-05-07 Chris Dumez <cdumez@apple.com> 2 34 -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r231367 r231456 97 97 return; 98 98 99 parentFrame->loader().subframeLoader().requestFrame(*this, m_URL, m_frameName, lockHistory, lockBackForwardList);99 parentFrame->loader().subframeLoader().requestFrame(*this, m_URL, getNameAttribute(), lockHistory, lockBackForwardList); 100 100 } 101 101 … … 106 106 else if (name == srcAttr && !hasAttributeWithoutSynchronization(srcdocAttr)) 107 107 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); 108 else if (name == idAttr) { 109 HTMLFrameOwnerElement::parseAttribute(name, value); 110 // Falling back to using the 'id' attribute is not standard but some content relies on this behavior. 111 if (!hasAttributeWithoutSynchronization(nameAttr)) 112 m_frameName = value; 113 } else if (name == nameAttr) { 114 m_frameName = value; 115 // FIXME: If we are already attached, this doesn't actually change the frame's name. 116 // FIXME: If we are already attached, this doesn't check for frame name 117 // conflicts and generate a unique frame name. 118 } else if (name == marginwidthAttr) { 108 else if (name == marginwidthAttr) { 119 109 m_marginWidth = value.toInt(); 120 110 // FIXME: If we are already attached, this has no effect. … … 133 123 } 134 124 135 void HTMLFrameElementBase::setNameAndOpenURL()136 {137 m_frameName = getNameAttribute();138 // Falling back to using the 'id' attribute is not standard but some content relies on this behavior.139 if (m_frameName.isNull())140 m_frameName = getIdAttribute();141 openURL();142 }143 144 125 Node::InsertedIntoAncestorResult HTMLFrameElementBase::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree) 145 126 { … … 164 145 if (!renderer()) 165 146 invalidateStyleAndRenderersForSubtree(); 166 setNameAndOpenURL();147 openURL(); 167 148 } 168 149 -
trunk/Source/WebCore/html/HTMLFrameElementBase.h
r231367 r231456 71 71 bool isFrameElementBase() const final { return true; } 72 72 73 void setNameAndOpenURL();74 73 void openURL(LockHistory = LockHistory::Yes, LockBackForwardList = LockBackForwardList::Yes); 75 74 76 75 AtomicString m_URL; 77 AtomicString m_frameName;78 76 79 77 ScrollbarMode m_scrolling;
Note: See TracChangeset
for help on using the changeset viewer.