Changeset 284745 in webkit


Ignore:
Timestamp:
Oct 23, 2021 9:35:34 AM (9 months ago)
Author:
Chris Dumez
Message:

anchor.relList.supports("opener") should return true
https://bugs.webkit.org/show_bug.cgi?id=232182

Reviewed by Darin Adler.

Source/WebCore:

anchor.relList.supports("opener") should return true since we support "opener" on
anchor elements.

No new tests, updated existing test.

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::relList):

LayoutTests:

Add layout test coverage.

  • fast/dom/DOMTokenList-supports-expected.txt:
  • fast/dom/DOMTokenList-supports.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284741 r284745  
     12021-10-23  Chris Dumez  <cdumez@apple.com>
     2
     3        anchor.relList.supports("opener") should return true
     4        https://bugs.webkit.org/show_bug.cgi?id=232182
     5
     6        Reviewed by Darin Adler.
     7
     8        Add layout test coverage.
     9
     10        * fast/dom/DOMTokenList-supports-expected.txt:
     11        * fast/dom/DOMTokenList-supports.html:
     12
    1132021-10-22  Jean-Yves Avenard  <jya@apple.com>
    214
  • trunk/LayoutTests/fast/dom/DOMTokenList-supports-expected.txt

    r207840 r284745  
    88* HTMLLinkElement.relList
    99PASS link.relList.__proto__ is DOMTokenList.prototype
    10 PASS link.relList.supports(linkRelSupportedValues[i]) is true
    11 PASS link.relList.supports(linkRelSupportedValues[i].toUpperCase()) is true
    12 PASS link.relList.supports(linkRelSupportedValues[i]) is true
    13 PASS link.relList.supports(linkRelSupportedValues[i].toUpperCase()) is true
    14 PASS link.relList.supports(linkRelSupportedValues[i]) is true
    15 PASS link.relList.supports(linkRelSupportedValues[i].toUpperCase()) is true
    16 PASS link.relList.supports(linkRelSupportedValues[i]) is true
    17 PASS link.relList.supports(linkRelSupportedValues[i].toUpperCase()) is true
     10PASS link.relList.supports('alternate') is true
     11PASS link.relList.supports('ALTERNATE') is true
     12PASS link.relList.supports('dns-prefetch') is true
     13PASS link.relList.supports('DNS-PREFETCH') is true
     14PASS link.relList.supports('icon') is true
     15PASS link.relList.supports('ICON') is true
     16PASS link.relList.supports('stylesheet') is true
     17PASS link.relList.supports('STYLESHEET') is true
    1818PASS link.relList.supports('unsupported') is false
    1919
    2020* HTMLAnchorElement.relList
    2121PASS anchor.relList.__proto__ is DOMTokenList.prototype
    22 PASS anchor.relList.supports(anchorRelSupportedValues[i]) is true
    23 PASS anchor.relList.supports(anchorRelSupportedValues[i].toUpperCase()) is true
    24 PASS anchor.relList.supports(anchorRelSupportedValues[i]) is true
    25 PASS anchor.relList.supports(anchorRelSupportedValues[i].toUpperCase()) is true
     22PASS anchor.relList.supports('noreferrer') is true
     23PASS anchor.relList.supports('NOREFERRER') is true
     24PASS anchor.relList.supports('noopener') is true
     25PASS anchor.relList.supports('NOOPENER') is true
     26PASS anchor.relList.supports('opener') is true
     27PASS anchor.relList.supports('OPENER') is true
    2628PASS anchor.relList.supports('unsupported') is false
    2729
    2830* HTMLAreaElement.relList
    2931PASS area.relList.__proto__ is DOMTokenList.prototype
    30 PASS area.relList.supports(areaRelSupportedValues[i]) is true
    31 PASS area.relList.supports(areaRelSupportedValues[i].toUpperCase()) is true
    32 PASS area.relList.supports(areaRelSupportedValues[i]) is true
    33 PASS area.relList.supports(areaRelSupportedValues[i].toUpperCase()) is true
     32PASS area.relList.supports('noreferrer') is true
     33PASS area.relList.supports('NOREFERRER') is true
     34PASS area.relList.supports('noopener') is true
     35PASS area.relList.supports('NOOPENER') is true
    3436PASS area.relList.supports('unsupported') is false
    3537
    3638* HTMLIFrameElement.sandbox
    3739PASS iframe.sandbox.__proto__ is DOMTokenList.prototype
    38 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    39 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
    40 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    41 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
    42 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    43 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
    44 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    45 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
    46 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    47 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
    48 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i]) is true
    49 PASS iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase()) is true
     40PASS iframe.sandbox.supports('allow-forms') is true
     41PASS iframe.sandbox.supports('ALLOW-FORMS') is true
     42PASS iframe.sandbox.supports('allow-same-origin') is true
     43PASS iframe.sandbox.supports('ALLOW-SAME-ORIGIN') is true
     44PASS iframe.sandbox.supports('allow-scripts') is true
     45PASS iframe.sandbox.supports('ALLOW-SCRIPTS') is true
     46PASS iframe.sandbox.supports('allow-top-navigation') is true
     47PASS iframe.sandbox.supports('ALLOW-TOP-NAVIGATION') is true
     48PASS iframe.sandbox.supports('allow-pointer-lock') is true
     49PASS iframe.sandbox.supports('ALLOW-POINTER-LOCK') is true
     50PASS iframe.sandbox.supports('allow-popups') is true
     51PASS iframe.sandbox.supports('ALLOW-POPUPS') is true
    5052PASS iframe.sandbox.supports('unsupported') is false
    5153
  • trunk/LayoutTests/fast/dom/DOMTokenList-supports.html

    r207840 r284745  
    1414var linkRelSupportedValues = ["alternate", "dns-prefetch", "icon", "stylesheet"];
    1515for (var i = 0; i < linkRelSupportedValues.length; i++) {
    16     shouldBeTrue("link.relList.supports(linkRelSupportedValues[i])");
    17     shouldBeTrue("link.relList.supports(linkRelSupportedValues[i].toUpperCase())");
     16    shouldBeTrue("link.relList.supports('" + linkRelSupportedValues[i] + "')");
     17    shouldBeTrue("link.relList.supports('" + linkRelSupportedValues[i].toUpperCase() + "')");
    1818}
    1919shouldBeFalse("link.relList.supports('unsupported')");
     
    2323var anchor = document.createElement("a");
    2424shouldBe("anchor.relList.__proto__", "DOMTokenList.prototype");
    25 var anchorRelSupportedValues = ["noreferrer", "noopener"];
     25var anchorRelSupportedValues = ["noreferrer", "noopener", "opener"];
    2626for (var i = 0; i < anchorRelSupportedValues.length; i++) {
    27     shouldBeTrue("anchor.relList.supports(anchorRelSupportedValues[i])");
    28     shouldBeTrue("anchor.relList.supports(anchorRelSupportedValues[i].toUpperCase())");
     27    shouldBeTrue("anchor.relList.supports('" + anchorRelSupportedValues[i] + "')");
     28    shouldBeTrue("anchor.relList.supports('" + anchorRelSupportedValues[i].toUpperCase() + "')");
    2929}
    3030shouldBeFalse("anchor.relList.supports('unsupported')");
     
    3636var areaRelSupportedValues = ["noreferrer", "noopener"];
    3737for (var i = 0; i < areaRelSupportedValues.length; i++) {
    38     shouldBeTrue("area.relList.supports(areaRelSupportedValues[i])");
    39     shouldBeTrue("area.relList.supports(areaRelSupportedValues[i].toUpperCase())");
     38    shouldBeTrue("area.relList.supports('" + areaRelSupportedValues[i] + "')");
     39    shouldBeTrue("area.relList.supports('" + areaRelSupportedValues[i].toUpperCase() + "')");
    4040}
    4141shouldBeFalse("area.relList.supports('unsupported')");
     
    4747var iframeSandboxSupportedValues = ["allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups"];
    4848for (var i = 0; i < iframeSandboxSupportedValues.length; i++) {
    49     shouldBeTrue("iframe.sandbox.supports(iframeSandboxSupportedValues[i])");
    50     shouldBeTrue("iframe.sandbox.supports(iframeSandboxSupportedValues[i].toUpperCase())");
     49    shouldBeTrue("iframe.sandbox.supports('" + iframeSandboxSupportedValues[i] + "')");
     50    shouldBeTrue("iframe.sandbox.supports('" + iframeSandboxSupportedValues[i].toUpperCase() + "')");
    5151}
    5252shouldBeFalse("iframe.sandbox.supports('unsupported')");
     
    6969    var dropzoneSupportedValues = ["copy", "move", "link"];
    7070    for (var i = 0; i < dropzoneSupportedValues.length; i++) {
    71         shouldBeTrue("link.dropzone.supports(dropzoneSupportedValues[i])");
    72         shouldBeTrue("link.dropzone.supports(dropzoneSupportedValues[i].toUpperCase())");
     71        shouldBeTrue("link.dropzone.supports('" + dropzoneSupportedValues[i] + "')");
     72        shouldBeTrue("link.dropzone.supports('" + dropzoneSupportedValues[i].toUpperCase() + "')");
    7373    }
    7474    shouldBeFalse("link.dropzone.supports('unsupported')");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/rellist-feature-detection-expected.txt

    r249886 r284745  
    11
    22FAIL Make sure that relList based feature detection is working for <link> assert_true: tag = LINK, link type = modulepreload must be supported expected true got false
    3 FAIL Make sure that relList based feature detection is working for <a> assert_true: tag = A, link type = opener must be supported expected true got false
    4 FAIL Make sure that relList based feature detection is working for <area> assert_true: tag = AREA, link type = opener must be supported expected true got false
     3PASS Make sure that relList based feature detection is working for <a>
     4PASS Make sure that relList based feature detection is working for <area>
    55FAIL Make sure that relList based feature detection is working for <form> undefined is not an object (evaluating 'element.relList.contains')
    66
  • trunk/Source/WebCore/ChangeLog

    r284744 r284745  
     12021-10-23  Chris Dumez  <cdumez@apple.com>
     2
     3        anchor.relList.supports("opener") should return true
     4        https://bugs.webkit.org/show_bug.cgi?id=232182
     5
     6        Reviewed by Darin Adler.
     7
     8        anchor.relList.supports("opener") should return true since we support "opener" on
     9        anchor elements.
     10
     11        No new tests, updated existing test.
     12
     13        * html/HTMLAnchorElement.cpp:
     14        (WebCore::HTMLAnchorElement::relList):
     15
    1162021-10-23  Alan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r284730 r284745  
    322322                return true;
    323323#endif
    324             return equalIgnoringASCIICase(token, "noreferrer") || equalIgnoringASCIICase(token, "noopener");
     324            return equalIgnoringASCIICase(token, "noreferrer") || equalIgnoringASCIICase(token, "noopener") || equalIgnoringASCIICase(token, "opener");
    325325        });
    326326    }
Note: See TracChangeset for help on using the changeset viewer.