Changeset 243705 in webkit
- Timestamp:
- Apr 1, 2019, 12:05:17 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/html/browsers/the-window-object (added)
-
LayoutTests/http/wpt/html/browsers/the-window-object/support (added)
-
LayoutTests/http/wpt/html/browsers/the-window-object/support/noreferrer-target-webkit.html (added)
-
LayoutTests/http/wpt/html/browsers/the-window-object/window-open-noopener-webkit-expected.txt (added)
-
LayoutTests/http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html (added)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.cpp (modified) (4 diffs)
-
Source/WebCore/page/WindowFeatures.cpp (modified) (1 diff)
-
Source/WebCore/page/WindowFeatures.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243703 r243705 1 2019-04-01 Chris Dumez <cdumez@apple.com> 2 3 Support "noreferrer" for window.open() 4 https://bugs.webkit.org/show_bug.cgi?id=194533 5 6 Reviewed by Geoffrey Garen. 7 8 Add equivalent test to imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html 9 but which relies on localStorage instead of BroadcastChannel so that it works with WebKit. 10 11 * http/wpt/html/browsers/the-window-object/support/noreferrer-target-webkit.html: Added. 12 * http/wpt/html/browsers/the-window-object/window-open-noopener-webkit-expected.txt: Added. 13 * http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html: Added. 14 1 15 2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/ChangeLog
r243691 r243705 1 2019-04-01 Chris Dumez <cdumez@apple.com> 2 3 Support "noreferrer" for window.open() 4 https://bugs.webkit.org/show_bug.cgi?id=194533 5 6 Reviewed by Geoffrey Garen. 7 8 Rebaseline WPT test now that all checks are passing. 9 10 * web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer-expected.txt: 11 1 12 2019-04-01 Emilio Cobos Álvarez <emilio@crisal.io> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer-expected.txt
r243634 r243705 1 1 2 FAIL Tokenization of "noreferrer" should skip window features separators before feature assert_equals: " noreferrer" should activate feature "noreferrer" expected null but got object "[object Window]" 3 FAIL Feature "noreferrer" should be converted to ASCII lowercase assert_equals: "NOREFERRER" should activate feature "noreferrer" expected null but got object "[object Window]" 4 FAIL After "noreferrer", tokenization should skip window features separators that are not "=" or "," assert_equals: "noreferrer" should activate feature "noreferrer" expected null but got object "[object Window]" 5 FAIL Tokenizing "noreferrer" should ignore window feature separators except "," after initial "=" and before value assert_equals: "noreferrer= yes" should activate feature "noreferrer" expected null but got object "[object Window]" 6 FAIL Tokenizing "noreferrer" should read characters until first window feature separator as `value` assert_equals: "noreferrer=1" should set "noreferrer" expected null but got object "[object Window]" 7 FAIL Integer values other than 0 should activate the feature assert_equals: "noreferrer=1" should activate feature "noreferrer" expected null but got object "[object Window]" 2 PASS Tokenization of "noreferrer" should skip window features separators before feature 3 PASS Feature "noreferrer" should be converted to ASCII lowercase 4 PASS After "noreferrer", tokenization should skip window features separators that are not "=" or "," 5 PASS Tokenizing "noreferrer" should ignore window feature separators except "," after initial "=" and before value 6 PASS Tokenizing "noreferrer" should read characters until first window feature separator as `value` 7 PASS Integer values other than 0 should activate the feature 8 8 PASS Integer value of 0 should not activate "noreferrer" 9 9 PASS Invalid feature names should not tokenize as "noreferrer" -
trunk/Source/WebCore/ChangeLog
r243703 r243705 1 2019-04-01 Chris Dumez <cdumez@apple.com> 2 3 Support "noreferrer" for window.open() 4 https://bugs.webkit.org/show_bug.cgi?id=194533 5 6 Reviewed by Geoffrey Garen. 7 8 Support "noreferrer" for window.open() as per: 9 - https://github.com/whatwg/html/pull/4331 10 11 Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer.html 12 http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html 13 14 * page/DOMWindow.cpp: 15 (WebCore::DOMWindow::createWindow): 16 * page/WindowFeatures.cpp: 17 (WebCore::setWindowFeature): 18 * page/WindowFeatures.h: 19 1 20 2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com> 2 21 -
trunk/Source/WebCore/page/DOMWindow.cpp
r243669 r243705 2289 2289 2290 2290 // For whatever reason, Firefox uses the first frame to determine the outgoingReferrer. We replicate that behavior here. 2291 String referrer = SecurityPolicy::generateReferrerHeader(firstFrame.document()->referrerPolicy(), completedURL, firstFrame.loader().outgoingReferrer());2291 String referrer = windowFeatures.noreferrer ? String() : SecurityPolicy::generateReferrerHeader(firstFrame.document()->referrerPolicy(), completedURL, firstFrame.loader().outgoingReferrer()); 2292 2292 auto initiatedByMainFrame = activeFrame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown; 2293 2293 … … 2303 2303 return RefPtr<Frame> { nullptr }; 2304 2304 2305 if (!windowFeatures.noopener) 2305 bool noopener = windowFeatures.noopener || windowFeatures.noreferrer; 2306 if (!noopener) 2306 2307 newFrame->loader().setOpener(&openerFrame); 2307 2308 … … 2310 2311 2311 2312 if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL)) 2312 return windowFeatures.noopener ? RefPtr<Frame> { nullptr } : newFrame;2313 return noopener ? RefPtr<Frame> { nullptr } : newFrame; 2313 2314 2314 2315 if (prepareDialogFunction) … … 2329 2330 return RefPtr<Frame> { nullptr }; 2330 2331 2331 return windowFeatures.noopener ? RefPtr<Frame> { nullptr } : newFrame;2332 return noopener ? RefPtr<Frame> { nullptr } : newFrame; 2332 2333 } 2333 2334 -
trunk/Source/WebCore/page/WindowFeatures.cpp
r239461 r243705 160 160 else if (equalLettersIgnoringASCIICase(key, "noopener")) 161 161 features.noopener = numericValue; 162 else if (equalLettersIgnoringASCIICase(key, "noreferrer")) 163 features.noreferrer = numericValue; 162 164 else if (numericValue == 1) 163 165 features.additionalFeatures.append(key.toString()); -
trunk/Source/WebCore/page/WindowFeatures.h
r239427 r243705 56 56 bool dialog { false }; 57 57 bool noopener { false }; 58 bool noreferrer { false }; 58 59 59 60 Vector<String> additionalFeatures;
Note:
See TracChangeset
for help on using the changeset viewer.