Changeset 287996 in webkit


Ignore:
Timestamp:
Jan 13, 2022 3:19:39 PM (6 months ago)
Author:
Chris Dumez
Message:

Implement HTMLScriptElement.supports(type) method
https://bugs.webkit.org/show_bug.cgi?id=229929
<rdar://problem/82933899>

Reviewed by Geoff Garen and Darin Adler.

LayoutTests/imported/w3c:

Rebaseline test now that more checks are passing.

  • web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt:

Source/WebCore:

Implement HTMLScriptElement.supports(type) method which was fairly recently
introduced in the HTML specification:

Blink and Gecko already implement this.

No new tests, rebaselined existing tests.

  • html/HTMLScriptElement.h:
  • html/HTMLScriptElement.idl:

LayoutTests:

Rebaseline test now that more checks are passing.

  • platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r287993 r287996  
     12022-01-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement HTMLScriptElement.supports(type) method
     4        https://bugs.webkit.org/show_bug.cgi?id=229929
     5        <rdar://problem/82933899>
     6
     7        Reviewed by Geoff Garen and Darin Adler.
     8
     9        Rebaseline test now that more checks are passing.
     10
     11        * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     12        * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     13
    1142022-01-13  Gabriel Nava Marino  <gnavamarino@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287977 r287996  
     12022-01-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement HTMLScriptElement.supports(type) method
     4        https://bugs.webkit.org/show_bug.cgi?id=229929
     5        <rdar://problem/82933899>
     6
     7        Reviewed by Geoff Garen and Darin Adler.
     8
     9        Rebaseline test now that more checks are passing.
     10
     11        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt:
     12
    1132022-01-13  Ziran Sun  <zsun@igalia.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt

    r285346 r287996  
    11
    2 FAIL Type of HTMLScriptElement.supports is function assert_equals: expected "function" but got "undefined"
    3 FAIL HTMLScriptElement.supports resurns true for 'classic' HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('classic')', 'HTMLScriptElement.supports' is undefined)
    4 FAIL HTMLScriptElement.supports resurns true for 'module' HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('module')', 'HTMLScriptElement.supports' is undefined)
    5 FAIL HTMLScriptElement.supports returns false for JavaScript MIME types HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('application/ecmascript')', 'HTMLScriptElement.supports' is undefined)
    6 FAIL HTMLScriptElement.supports returns false for unsupported types HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('')', 'HTMLScriptElement.supports' is undefined)
     2PASS Type of HTMLScriptElement.supports is function
     3PASS HTMLScriptElement.supports resurns true for 'classic'
     4PASS HTMLScriptElement.supports resurns true for 'module'
     5PASS HTMLScriptElement.supports returns false for JavaScript MIME types
     6PASS HTMLScriptElement.supports returns false for unsupported types
    77
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r286550 r287996  
    38363836PASS HTMLScriptElement interface: attribute integrity
    38373837PASS HTMLScriptElement interface: attribute referrerPolicy
    3838 FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
     3838PASS HTMLScriptElement interface: operation supports(DOMString)
    38393839PASS HTMLScriptElement interface: attribute charset
    38403840PASS HTMLScriptElement interface: attribute event
     
    38523852PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
    38533853PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
    3854 FAIL HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError assert_own_property: interface object must have static operation as own property expected property "supports" missing
     3854PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
    38553855PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
    38563856PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r287780 r287996  
    38263826PASS HTMLScriptElement interface: attribute integrity
    38273827PASS HTMLScriptElement interface: attribute referrerPolicy
    3828 FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
     3828PASS HTMLScriptElement interface: operation supports(DOMString)
    38293829PASS HTMLScriptElement interface: attribute charset
    38303830PASS HTMLScriptElement interface: attribute event
     
    38423842PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
    38433843PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
    3844 FAIL HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError assert_own_property: interface object must have static operation as own property expected property "supports" missing
     3844PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
    38453845PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
    38463846PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
  • trunk/LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r287780 r287996  
    38363836PASS HTMLScriptElement interface: attribute integrity
    38373837PASS HTMLScriptElement interface: attribute referrerPolicy
    3838 FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
     3838PASS HTMLScriptElement interface: operation supports(DOMString)
    38393839PASS HTMLScriptElement interface: attribute charset
    38403840PASS HTMLScriptElement interface: attribute event
     
    38523852PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
    38533853PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
    3854 FAIL HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError assert_own_property: interface object must have static operation as own property expected property "supports" missing
     3854PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
    38553855PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
    38563856PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r286550 r287996  
    38363836PASS HTMLScriptElement interface: attribute integrity
    38373837PASS HTMLScriptElement interface: attribute referrerPolicy
    3838 FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
     3838PASS HTMLScriptElement interface: operation supports(DOMString)
    38393839PASS HTMLScriptElement interface: attribute charset
    38403840PASS HTMLScriptElement interface: attribute event
     
    38523852PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
    38533853PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
    3854 FAIL HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError assert_own_property: interface object must have static operation as own property expected property "supports" missing
     3854PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
    38553855PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
    38563856PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
  • trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r287657 r287996  
    38363836PASS HTMLScriptElement interface: attribute integrity
    38373837PASS HTMLScriptElement interface: attribute referrerPolicy
    3838 FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
     3838PASS HTMLScriptElement interface: operation supports(DOMString)
    38393839PASS HTMLScriptElement interface: attribute charset
    38403840PASS HTMLScriptElement interface: attribute event
     
    38523852PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
    38533853PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
    3854 FAIL HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError assert_own_property: interface object must have static operation as own property expected property "supports" missing
     3854PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
    38553855PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
    38563856PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
  • trunk/Source/WebCore/ChangeLog

    r287993 r287996  
     12022-01-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement HTMLScriptElement.supports(type) method
     4        https://bugs.webkit.org/show_bug.cgi?id=229929
     5        <rdar://problem/82933899>
     6
     7        Reviewed by Geoff Garen and Darin Adler.
     8
     9        Implement HTMLScriptElement.supports(type) method which was fairly recently
     10        introduced in the HTML specification:
     11        - https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports
     12
     13        Blink and Gecko already implement this.
     14
     15        No new tests, rebaselined existing tests.
     16
     17        * html/HTMLScriptElement.h:
     18        * html/HTMLScriptElement.idl:
     19
    1202022-01-13  Gabriel Nava Marino  <gnavamarino@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLScriptElement.h

    r247509 r287996  
    5252    using HTMLElement::deref;
    5353
     54    static bool supports(StringView type) { return type == "classic" || type == "module"; }
     55
    5456private:
    5557    HTMLScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted);
  • trunk/Source/WebCore/html/HTMLScriptElement.idl

    r285478 r287996  
    3434    [CEReactions=NotNeeded, Reflect, EnabledBySetting=SubresourceIntegrityEnabled] attribute DOMString integrity;
    3535    [EnabledBySetting=ReferrerPolicyAttributeEnabled, ImplementedAs=referrerPolicyForBindings, CEReactions=NotNeeded] attribute DOMString referrerPolicy;
     36
     37    static boolean supports(DOMString type);
    3638};
Note: See TracChangeset for help on using the changeset viewer.