HTMLScriptElement.supports(type) method was introduced by the recent spec change. https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports https://github.com/whatwg/html/pull/7008
Thank you for filing. The appropriate engineers have been copied.
<rdar://problem/82933899>
Created attachment 449090 [details] Patch
Comment on attachment 449090 [details] Patch r=me
Comment on attachment 449090 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449090&action=review > Source/WebCore/html/HTMLScriptElement.cpp:209 > +bool HTMLScriptElement::supports(const String& type) > +{ > + return type == "classic" || type == "module"; > } I would make two changes: 1) Take StringView; good practice any time we don’t need to take ownership of the String or take advantage of the hash value stored in the string 2) Put this inline in the header; why not for something this simple that could be inlined into the bindings code?
Created attachment 449102 [details] Patch
(In reply to Darin Adler from comment #5) > Comment on attachment 449090 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449090&action=review > > > Source/WebCore/html/HTMLScriptElement.cpp:209 > > +bool HTMLScriptElement::supports(const String& type) > > +{ > > + return type == "classic" || type == "module"; > > } > > I would make two changes: > > 1) Take StringView; good practice any time we don’t need to take ownership > of the String or take advantage of the hash value stored in the string > > 2) Put this inline in the header; why not for something this simple that > could be inlined into the bindings code? Done, thanks.
ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.
Committed r287996 (246023@trunk): <https://commits.webkit.org/246023@trunk>