Implement the "noopener" feature for window.open()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Mar 2017 16:15:16 +0000 (16:15 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Mar 2017 16:15:16 +0000 (16:15 +0000)
commitbb08757ba6efff5fe0f3f0ceb77ec9ba9ad7d665
tree99f881b06eceb3650f9e99ff39743f4dfee7d232
parent9b363428fb3905a8e38357ab16cdc2599fa37093
Implement the "noopener" feature for window.open()
https://bugs.webkit.org/show_bug.cgi?id=163960
<rdar://problem/28941679>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Import test coverage from WPT upstream.

* resources/import-expectations.json:
* web-platform-tests/common/PrefixedLocalStorage.js: Added.
(PrefixedLocalStorage):
(PrefixedLocalStorage.prototype.clear):
(PrefixedLocalStorage.prototype.url):
(PrefixedLocalStorage.prototype.prefixedKey):
(PrefixedLocalStorage.prototype.setItem):
(PrefixedLocalStorage.prototype.onSet):
(PrefixedLocalStorageTest):
(PrefixedLocalStorageTest.prototype.cleanup):
(PrefixedLocalStorageResource):
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer-expected.txt: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html: Added.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/w3c-import.log.
* web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/w3c-import.log:

Source/WebCore:

Implement the "noopener" feature for window.open(). If 'noopener' is passed to window.open()
then the new Window's opener property will be null.

Tests: imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html
       imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/WindowFeatures.cpp:
(WebCore::parseWindowFeatures):
(WebCore::setWindowFeature):
* page/WindowFeatures.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/common/PrefixedLocalStorage.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/common/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/WindowFeatures.cpp
Source/WebCore/page/WindowFeatures.h