Changeset 280933 in webkit


Ignore:
Timestamp:
Aug 11, 2021 3:21:57 PM (11 months ago)
Author:
Chris Dumez
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:

Firefox and Chrome match the specification.

No new tests, rebaselined existing tests.

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::handleClick):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r280924 r280933  
     12021-08-11  Chris Dumez  <cdumez@apple.com>
     2
     3        <a rel="opener noopener" target="_blank"> should create a window without opener
     4        https://bugs.webkit.org/show_bug.cgi?id=229011
     5
     6        Reviewed by Alex Christensen.
     7
     8        Rebaseline WPT tests that are now passing.
     9
     10        * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt:
     11        * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt:
     12
    1132021-08-11  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt

    r279971 r280933  
    44PASS Anchor element with target=_blank with rel=opener
    55PASS Anchor element with target=_blank with implicit rel=noopener
    6 FAIL Anchor element with target=_blank with rel=opener+noopener assert_equals: expected false but got true
    7 FAIL Anchor element with target=_blank with rel=noopener+opener assert_equals: expected false but got true
     6PASS Anchor element with target=_blank with rel=opener+noopener
     7PASS Anchor element with target=_blank with rel=noopener+opener
    88PASS Anchor element with target=_blank with rel=noreferrer
    9 FAIL Anchor element with target=_blank with rel=opener+noreferrer assert_equals: expected false but got true
    10 FAIL Anchor element with target=_blank with rel=noopener+opener+noreferrer assert_equals: expected false but got true
     9PASS Anchor element with target=_blank with rel=opener+noreferrer
     10PASS Anchor element with target=_blank with rel=noopener+opener+noreferrer
    1111PASS Area element with target=_blank with rel=noopener
    1212PASS Area element with target=_blank with rel=opener
    1313PASS Area element with target=_blank with implicit rel=noopener
    14 FAIL Area element with target=_blank with rel=opener+noopener assert_equals: expected false but got true
    15 FAIL Area element with target=_blank with rel=noopener+opener assert_equals: expected false but got true
     14PASS Area element with target=_blank with rel=opener+noopener
     15PASS Area element with target=_blank with rel=noopener+opener
    1616
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt

    r279971 r280933  
    44PASS Anchor element with base target=_blank with rel=opener
    55PASS Anchor element with base target=_blank with implicit rel=noopener
    6 FAIL Anchor element with base target=_blank with rel=opener+noopener assert_equals: expected false but got true
    7 FAIL Anchor element with base target=_blank with rel=noopener+opener assert_equals: expected false but got true
     6PASS Anchor element with base target=_blank with rel=opener+noopener
     7PASS Anchor element with base target=_blank with rel=noopener+opener
    88PASS Anchor element with base target=_blank with rel=noreferrer
    9 FAIL Anchor element with base target=_blank with rel=opener+noreferrer assert_equals: expected false but got true
    10 FAIL Anchor element with base target=_blank with rel=noopener+opener+noreferrer assert_equals: expected false but got true
     9PASS Anchor element with base target=_blank with rel=opener+noreferrer
     10PASS Anchor element with base target=_blank with rel=noopener+opener+noreferrer
    1111PASS Area element with base target=_blank with rel=noopener
    1212PASS Area element with base target=_blank with rel=opener
    1313PASS Area element with base target=_blank with implicit rel=noopener
    14 FAIL Area element with base target=_blank with rel=opener+noopener assert_equals: expected false but got true
    15 FAIL Area element with base target=_blank with rel=noopener+opener assert_equals: expected false but got true
     14PASS Area element with base target=_blank with rel=opener+noopener
     15PASS Area element with base target=_blank with rel=noopener+opener
    1616
  • trunk/Source/WebCore/ChangeLog

    r280931 r280933  
     12021-08-11  Chris Dumez  <cdumez@apple.com>
     2
     3        <a rel="opener noopener" target="_blank"> should create a window without opener
     4        https://bugs.webkit.org/show_bug.cgi?id=229011
     5
     6        Reviewed by Alex Christensen.
     7
     8        <a rel="opener noopener" target="_blank"> should create a window without opener, as per:
     9        - https://html.spec.whatwg.org/#get-an-element's-noopener (noopener is checked *before* opener).
     10
     11        Firefox and Chrome match the specification.
     12
     13        No new tests, rebaselined existing tests.
     14
     15        * html/HTMLAnchorElement.cpp:
     16        (WebCore::HTMLAnchorElement::handleClick):
     17
    1182021-08-11  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r279760 r280933  
    518518
    519519    auto effectiveTarget = this->effectiveTarget();
    520     std::optional<NewFrameOpenerPolicy> newFrameOpenerPolicy;
    521     if (hasRel(Relation::Opener))
    522         newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow;
    523     else if (hasRel(Relation::NoOpener) || (document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank")))
     520    NewFrameOpenerPolicy newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow;
     521    if (hasRel(Relation::NoOpener) || hasRel(Relation::NoReferrer) || (!hasRel(Relation::Opener) && document().settings().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank")))
    524522        newFrameOpenerPolicy = NewFrameOpenerPolicy::Suppress;
    525523
Note: See TracChangeset for help on using the changeset viewer.