forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment: target=_blank on anchors should imply rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=190481 Reviewed by Alex Christensen. Source/WebCore: As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security. WebContent can then request an opener relationship by using `rel=opener` instead. This change was discussed at: - whatwg/html#4078 We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate that OAuth workflows still work. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::effectiveTarget const): * html/HTMLAnchorElement.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): Source/WebKit: * Shared/WebPreferences.yaml: Tools: Add API test coverage to make sure we can now swap process when target=_blank is specified on an anchor but rel=noopener is not. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: LayoutTests: Update existing tests to reflect behavior change. * TestExpectations: * http/tests/navigation/no-referrer-reset.html: * http/tests/security/resources/referrer-policy-redirect-link.html: * http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html: * http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html: * http/tests/security/xssAuditor/link-opens-new-window.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
0c0d330
commit 17638e7
Showing
18 changed files
with
199 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
2018-10-15 Chris Dumez <[email protected]> | ||
|
||
Experiment: target=_blank on anchors should imply rel=noopener | ||
https://bugs.webkit.org/show_bug.cgi?id=190481 | ||
|
||
Reviewed by Alex Christensen. | ||
|
||
Update existing tests to reflect behavior change. | ||
|
||
* TestExpectations: | ||
* http/tests/navigation/no-referrer-reset.html: | ||
* http/tests/security/resources/referrer-policy-redirect-link.html: | ||
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html: | ||
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html: | ||
* http/tests/security/xssAuditor/link-opens-new-window.html: | ||
|
||
2018-10-15 Andy Estes <[email protected]> | ||
|
||
[Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
LayoutTests/http/tests/navigation/anchor-blank-target-implies-rel-noopener-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CONSOLE MESSAGE: line 6: PASS: New window should not have an opener | ||
Tests that a new window opened via target=_blank does not have an opener | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
LayoutTests/http/tests/navigation/anchor-blank-target-implies-rel-noopener.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p>Tests that a new window opened via target=_blank does not have an opener</p> | ||
<a id="testAnchor" href="resources/anchor-blank-target-implies-rel-noopener-win.html" target="_blank"></a> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
testRunner.setCanOpenWindows(); | ||
} | ||
|
||
onload = function() { | ||
setTimeout(() => { | ||
testAnchor.click(); | ||
}, 0); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...utTests/http/tests/navigation/resources/anchor-blank-target-implies-rel-noopener-win.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script> | ||
if (!window.opener) | ||
console.log("PASS: New window should not have an opener"); | ||
else | ||
console.log("FAIL: New window should not have an opener"); | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
2018-10-15 Chris Dumez <[email protected]> | ||
|
||
Experiment: target=_blank on anchors should imply rel=noopener | ||
https://bugs.webkit.org/show_bug.cgi?id=190481 | ||
|
||
Reviewed by Alex Christensen. | ||
|
||
As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security. | ||
WebContent can then request an opener relationship by using `rel=opener` instead. | ||
|
||
This change was discussed at: | ||
- https://github.com/whatwg/html/issues/4078 | ||
|
||
We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate | ||
that OAuth workflows still work. | ||
|
||
* html/HTMLAnchorElement.cpp: | ||
(WebCore::HTMLAnchorElement::parseAttribute): | ||
(WebCore::HTMLAnchorElement::handleClick): | ||
(WebCore::HTMLAnchorElement::effectiveTarget const): | ||
* html/HTMLAnchorElement.h: | ||
* page/RuntimeEnabledFeatures.h: | ||
(WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): | ||
(WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): | ||
|
||
2018-10-15 Andy Estes <[email protected]> | ||
|
||
[Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
2018-10-15 Chris Dumez <[email protected]> | ||
|
||
Experiment: target=_blank on anchors should imply rel=noopener | ||
https://bugs.webkit.org/show_bug.cgi?id=190481 | ||
|
||
Reviewed by Alex Christensen. | ||
|
||
* Shared/WebPreferences.yaml: | ||
|
||
2018-10-15 Alex Christensen <[email protected]> | ||
|
||
Remove unused parameters from FrameLoaderClient::createFrame | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
2018-10-15 Chris Dumez <[email protected]> | ||
|
||
Experiment: target=_blank on anchors should imply rel=noopener | ||
https://bugs.webkit.org/show_bug.cgi?id=190481 | ||
|
||
Reviewed by Alex Christensen. | ||
|
||
Add API test coverage to make sure we can now swap process when target=_blank | ||
is specified on an anchor but rel=noopener is not. | ||
|
||
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: | ||
|
||
2018-10-15 Wenson Hsieh <[email protected]> | ||
|
||
[iOS] Can't select text after dismissing the keyboard when changing focus | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters