Title: [287996] trunk
Revision
287996
Author
[email protected]
Date
2022-01-13 15:19:39 -0800 (Thu, 13 Jan 2022)

Log 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:
- https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports

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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287995 => 287996)


--- trunk/LayoutTests/ChangeLog	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/ChangeLog	2022-01-13 23:19:39 UTC (rev 287996)
@@ -1,3 +1,16 @@
+2022-01-13  Chris Dumez  <[email protected]>
+
+        Implement HTMLScriptElement.supports(type) method
+        https://bugs.webkit.org/show_bug.cgi?id=229929
+        <rdar://problem/82933899>
+
+        Reviewed by Geoff Garen and Darin Adler.
+
+        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:
+
 2022-01-13  Gabriel Nava Marino  <[email protected]>
 
         null ptr deref while trying to access DeferredPromise::promise()

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287995 => 287996)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-13 23:19:39 UTC (rev 287996)
@@ -1,3 +1,15 @@
+2022-01-13  Chris Dumez  <[email protected]>
+
+        Implement HTMLScriptElement.supports(type) method
+        https://bugs.webkit.org/show_bug.cgi?id=229929
+        <rdar://problem/82933899>
+
+        Reviewed by Geoff Garen and Darin Adler.
+
+        Rebaseline test now that more checks are passing.
+
+        * web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt:
+
 2022-01-13  Ziran Sun  <[email protected]>
 
         [css-grid] Fix rounding of distributed free space to flexible tracks

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt (287995 => 287996)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-supports-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -1,7 +1,7 @@
 
-FAIL Type of HTMLScriptElement.supports is function assert_equals: expected "function" but got "undefined"
-FAIL HTMLScriptElement.supports resurns true for 'classic' HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('classic')', 'HTMLScriptElement.supports' is undefined)
-FAIL HTMLScriptElement.supports resurns true for 'module' HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('module')', 'HTMLScriptElement.supports' is undefined)
-FAIL HTMLScriptElement.supports returns false for _javascript_ MIME types HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('application/ecmascript')', 'HTMLScriptElement.supports' is undefined)
-FAIL HTMLScriptElement.supports returns false for unsupported types HTMLScriptElement.supports is not a function. (In 'HTMLScriptElement.supports('')', 'HTMLScriptElement.supports' is undefined)
+PASS Type of HTMLScriptElement.supports is function
+PASS HTMLScriptElement.supports resurns true for 'classic'
+PASS HTMLScriptElement.supports resurns true for 'module'
+PASS HTMLScriptElement.supports returns false for _javascript_ MIME types
+PASS HTMLScriptElement.supports returns false for unsupported types
 

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (287995 => 287996)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -3835,7 +3835,7 @@
 PASS HTMLScriptElement interface: attribute text
 PASS HTMLScriptElement interface: attribute integrity
 PASS HTMLScriptElement interface: attribute referrerPolicy
-FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
+PASS HTMLScriptElement interface: operation supports(DOMString)
 PASS HTMLScriptElement interface: attribute charset
 PASS HTMLScriptElement interface: attribute event
 PASS HTMLScriptElement interface: attribute htmlFor
@@ -3851,7 +3851,7 @@
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
-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
+PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (287995 => 287996)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -3825,7 +3825,7 @@
 PASS HTMLScriptElement interface: attribute text
 PASS HTMLScriptElement interface: attribute integrity
 PASS HTMLScriptElement interface: attribute referrerPolicy
-FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
+PASS HTMLScriptElement interface: operation supports(DOMString)
 PASS HTMLScriptElement interface: attribute charset
 PASS HTMLScriptElement interface: attribute event
 PASS HTMLScriptElement interface: attribute htmlFor
@@ -3841,7 +3841,7 @@
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
-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
+PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type

Modified: trunk/LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (287995 => 287996)


--- trunk/LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -3835,7 +3835,7 @@
 PASS HTMLScriptElement interface: attribute text
 PASS HTMLScriptElement interface: attribute integrity
 PASS HTMLScriptElement interface: attribute referrerPolicy
-FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
+PASS HTMLScriptElement interface: operation supports(DOMString)
 PASS HTMLScriptElement interface: attribute charset
 PASS HTMLScriptElement interface: attribute event
 PASS HTMLScriptElement interface: attribute htmlFor
@@ -3851,7 +3851,7 @@
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
-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
+PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type

Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (287995 => 287996)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -3835,7 +3835,7 @@
 PASS HTMLScriptElement interface: attribute text
 PASS HTMLScriptElement interface: attribute integrity
 PASS HTMLScriptElement interface: attribute referrerPolicy
-FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
+PASS HTMLScriptElement interface: operation supports(DOMString)
 PASS HTMLScriptElement interface: attribute charset
 PASS HTMLScriptElement interface: attribute event
 PASS HTMLScriptElement interface: attribute htmlFor
@@ -3851,7 +3851,7 @@
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
-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
+PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type

Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (287995 => 287996)


--- trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt	2022-01-13 23:19:39 UTC (rev 287996)
@@ -3835,7 +3835,7 @@
 PASS HTMLScriptElement interface: attribute text
 PASS HTMLScriptElement interface: attribute integrity
 PASS HTMLScriptElement interface: attribute referrerPolicy
-FAIL HTMLScriptElement interface: operation supports(DOMString) assert_own_property: interface object missing static operation expected property "supports" missing
+PASS HTMLScriptElement interface: operation supports(DOMString)
 PASS HTMLScriptElement interface: attribute charset
 PASS HTMLScriptElement interface: attribute event
 PASS HTMLScriptElement interface: attribute htmlFor
@@ -3851,7 +3851,7 @@
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "supports(DOMString)" with the proper type
-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
+PASS HTMLScriptElement interface: calling supports(DOMString) on document.createElement("script") with too few arguments must throw TypeError
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type
 PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type

Modified: trunk/Source/WebCore/ChangeLog (287995 => 287996)


--- trunk/Source/WebCore/ChangeLog	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/Source/WebCore/ChangeLog	2022-01-13 23:19:39 UTC (rev 287996)
@@ -1,3 +1,22 @@
+2022-01-13  Chris Dumez  <[email protected]>
+
+        Implement HTMLScriptElement.supports(type) method
+        https://bugs.webkit.org/show_bug.cgi?id=229929
+        <rdar://problem/82933899>
+
+        Reviewed by Geoff Garen and Darin Adler.
+
+        Implement HTMLScriptElement.supports(type) method which was fairly recently
+        introduced in the HTML specification:
+        - https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports
+
+        Blink and Gecko already implement this.
+
+        No new tests, rebaselined existing tests.
+
+        * html/HTMLScriptElement.h:
+        * html/HTMLScriptElement.idl:
+
 2022-01-13  Gabriel Nava Marino  <[email protected]>
 
         null ptr deref while trying to access DeferredPromise::promise()

Modified: trunk/Source/WebCore/html/HTMLScriptElement.h (287995 => 287996)


--- trunk/Source/WebCore/html/HTMLScriptElement.h	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/Source/WebCore/html/HTMLScriptElement.h	2022-01-13 23:19:39 UTC (rev 287996)
@@ -51,6 +51,8 @@
     using HTMLElement::ref;
     using HTMLElement::deref;
 
+    static bool supports(StringView type) { return type == "classic" || type == "module"; }
+
 private:
     HTMLScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted);
 

Modified: trunk/Source/WebCore/html/HTMLScriptElement.idl (287995 => 287996)


--- trunk/Source/WebCore/html/HTMLScriptElement.idl	2022-01-13 23:04:00 UTC (rev 287995)
+++ trunk/Source/WebCore/html/HTMLScriptElement.idl	2022-01-13 23:19:39 UTC (rev 287996)
@@ -33,4 +33,6 @@
     [CEReactions=NotNeeded, Reflect] attribute boolean noModule;
     [CEReactions=NotNeeded, Reflect, EnabledBySetting=SubresourceIntegrityEnabled] attribute DOMString integrity;
     [EnabledBySetting=ReferrerPolicyAttributeEnabled, ImplementedAs=referrerPolicyForBindings, CEReactions=NotNeeded] attribute DOMString referrerPolicy;
+
+    static boolean supports(DOMString type);
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to