Title: [280933] trunk
Revision
280933
Author
[email protected]
Date
2021-08-11 15:21:57 -0700 (Wed, 11 Aug 2021)

Log Message

<a rel="opener noopener" target="_blank"> should create a window without opener
https://bugs.webkit.org/show_bug.cgi?id=229011

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt:
* web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt:

Source/WebCore:

<a rel="opener noopener" target="_blank"> should create a window without opener, as per:
- https://html.spec.whatwg.org/#get-an-element's-noopener (noopener is checked *before* opener).

Firefox and Chrome match the specification.

No new tests, rebaselined existing tests.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280932 => 280933)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-11 22:18:38 UTC (rev 280932)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-11 22:21:57 UTC (rev 280933)
@@ -1,5 +1,17 @@
 2021-08-11  Chris Dumez  <[email protected]>
 
+        <a rel="opener noopener" target="_blank"> should create a window without opener
+        https://bugs.webkit.org/show_bug.cgi?id=229011
+
+        Reviewed by Alex Christensen.
+
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt:
+        * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt:
+
+2021-08-11  Chris Dumez  <[email protected]>
+
         Stop evaluating <script>s moved between Documents during fetching
         https://bugs.webkit.org/show_bug.cgi?id=202714
         <rdar://problem/56208425>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt (280932 => 280933)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt	2021-08-11 22:18:38 UTC (rev 280932)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt	2021-08-11 22:21:57 UTC (rev 280933)
@@ -3,14 +3,14 @@
 PASS Anchor element with target=_blank with rel=noopener
 PASS Anchor element with target=_blank with rel=opener
 PASS Anchor element with target=_blank with implicit rel=noopener
-FAIL Anchor element with target=_blank with rel=opener+noopener assert_equals: expected false but got true
-FAIL Anchor element with target=_blank with rel=noopener+opener assert_equals: expected false but got true
+PASS Anchor element with target=_blank with rel=opener+noopener
+PASS Anchor element with target=_blank with rel=noopener+opener
 PASS Anchor element with target=_blank with rel=noreferrer
-FAIL Anchor element with target=_blank with rel=opener+noreferrer assert_equals: expected false but got true
-FAIL Anchor element with target=_blank with rel=noopener+opener+noreferrer assert_equals: expected false but got true
+PASS Anchor element with target=_blank with rel=opener+noreferrer
+PASS Anchor element with target=_blank with rel=noopener+opener+noreferrer
 PASS Area element with target=_blank with rel=noopener
 PASS Area element with target=_blank with rel=opener
 PASS Area element with target=_blank with implicit rel=noopener
-FAIL Area element with target=_blank with rel=opener+noopener assert_equals: expected false but got true
-FAIL Area element with target=_blank with rel=noopener+opener assert_equals: expected false but got true
+PASS Area element with target=_blank with rel=opener+noopener
+PASS Area element with target=_blank with rel=noopener+opener
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt (280932 => 280933)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt	2021-08-11 22:18:38 UTC (rev 280932)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt	2021-08-11 22:21:57 UTC (rev 280933)
@@ -3,14 +3,14 @@
 PASS Anchor element with base target=_blank with rel=noopener
 PASS Anchor element with base target=_blank with rel=opener
 PASS Anchor element with base target=_blank with implicit rel=noopener
-FAIL Anchor element with base target=_blank with rel=opener+noopener assert_equals: expected false but got true
-FAIL Anchor element with base target=_blank with rel=noopener+opener assert_equals: expected false but got true
+PASS Anchor element with base target=_blank with rel=opener+noopener
+PASS Anchor element with base target=_blank with rel=noopener+opener
 PASS Anchor element with base target=_blank with rel=noreferrer
-FAIL Anchor element with base target=_blank with rel=opener+noreferrer assert_equals: expected false but got true
-FAIL Anchor element with base target=_blank with rel=noopener+opener+noreferrer assert_equals: expected false but got true
+PASS Anchor element with base target=_blank with rel=opener+noreferrer
+PASS Anchor element with base target=_blank with rel=noopener+opener+noreferrer
 PASS Area element with base target=_blank with rel=noopener
 PASS Area element with base target=_blank with rel=opener
 PASS Area element with base target=_blank with implicit rel=noopener
-FAIL Area element with base target=_blank with rel=opener+noopener assert_equals: expected false but got true
-FAIL Area element with base target=_blank with rel=noopener+opener assert_equals: expected false but got true
+PASS Area element with base target=_blank with rel=opener+noopener
+PASS Area element with base target=_blank with rel=noopener+opener
 

Modified: trunk/Source/WebCore/ChangeLog (280932 => 280933)


--- trunk/Source/WebCore/ChangeLog	2021-08-11 22:18:38 UTC (rev 280932)
+++ trunk/Source/WebCore/ChangeLog	2021-08-11 22:21:57 UTC (rev 280933)
@@ -1,3 +1,20 @@
+2021-08-11  Chris Dumez  <[email protected]>
+
+        <a rel="opener noopener" target="_blank"> should create a window without opener
+        https://bugs.webkit.org/show_bug.cgi?id=229011
+
+        Reviewed by Alex Christensen.
+
+        <a rel="opener noopener" target="_blank"> should create a window without opener, as per:
+        - https://html.spec.whatwg.org/#get-an-element's-noopener (noopener is checked *before* opener).
+
+        Firefox and Chrome match the specification.
+
+        No new tests, rebaselined existing tests.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::handleClick):
+
 2021-08-11  Alex Christensen  <[email protected]>
 
         REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (280932 => 280933)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2021-08-11 22:18:38 UTC (rev 280932)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2021-08-11 22:21:57 UTC (rev 280933)
@@ -517,10 +517,8 @@
     auto referrerPolicy = hasRel(Relation::NoReferrer) ? ReferrerPolicy::NoReferrer : this->referrerPolicy();
 
     auto effectiveTarget = this->effectiveTarget();
-    std::optional<NewFrameOpenerPolicy> newFrameOpenerPolicy;
-    if (hasRel(Relation::Opener))
-        newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow;
-    else if (hasRel(Relation::NoOpener) || (document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank")))
+    NewFrameOpenerPolicy newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow;
+    if (hasRel(Relation::NoOpener) || hasRel(Relation::NoReferrer) || (!hasRel(Relation::Opener) && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank")))
         newFrameOpenerPolicy = NewFrameOpenerPolicy::Suppress;
 
     auto privateClickMeasurement = parsePrivateClickMeasurement();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to