WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

Replace StringContext IDL extended attribute with union types

Open lukewarlow opened this issue 9 months ago โ€ข 9 comments

c90d2cb2a5c7fb5d85f9e8bf766cf1ca981ad68e

Replace StringContext IDL extended attribute with union types
https://bugs.webkit.org/show_bug.cgi?id=273412

Reviewed by NOBODY (OOPS!).

This patch replaces most usages of the StringContext IDL extended attribute,
with union types and updates to the callsites to do the trusted type enforcement.

Follow up patches will address HTML timer functions and the StringContext code generator changes.

* Source/WebCore/dom/Document+HTML.idl:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::parseHTMLUnsafe):
(WebCore::Document::write):
(WebCore::Document::writeln):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Document.idl:
* Source/WebCore/dom/Element+DOMParsing.idl:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setHTMLUnsafe):
(WebCore::Element::setOuterHTML):
(WebCore::Element::setInnerHTML):
(WebCore::Element::insertAdjacentHTML):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/InnerHTML.idl:
* Source/WebCore/dom/Range+DOMParsing.idl:
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::createContextualFragment):
* Source/WebCore/dom/Range.h:
* Source/WebCore/dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setHTMLUnsafe):
(WebCore::ShadowRoot::setInnerHTML):
* Source/WebCore/dom/ShadowRoot.h:
* Source/WebCore/dom/TrustedType.cpp:
(WebCore::trustedTypeCompliantString):
* Source/WebCore/dom/TrustedType.h:
* Source/WebCore/html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::srcdoc const):
(WebCore::HTMLIFrameElement::setSrcdoc):
* Source/WebCore/html/HTMLIFrameElement.h:
* Source/WebCore/html/HTMLIFrameElement.idl:
* Source/WebCore/workers/Worker.cpp:
(WebCore::Worker::create):
* Source/WebCore/workers/Worker.h:
* Source/WebCore/workers/Worker.idl:
* Source/WebCore/workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* Source/WebCore/workers/WorkerGlobalScope.h:
* Source/WebCore/workers/WorkerGlobalScope.idl:
* Source/WebCore/workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
* Source/WebCore/workers/service/ServiceWorkerContainer.h:
* Source/WebCore/workers/service/ServiceWorkerContainer.idl:
* Source/WebCore/workers/shared/SharedWorker.cpp:
(WebCore::SharedWorker::create):
* Source/WebCore/workers/shared/SharedWorker.h:
* Source/WebCore/workers/shared/SharedWorker.idl:
* Source/WebCore/xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* Source/WebCore/xml/DOMParser.h:
* Source/WebCore/xml/DOMParser.idl:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Document-write-exception-order-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Document-write-exception-order.xhtml: Added.
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-outerHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-outerHTML.html:

https://github.com/WebKit/WebKit/commit/c90d2cb2a5c7fb5d85f9e8bf766cf1ca981ad68e

Misc iOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  wincairo
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-AS-debug โœ… ๐Ÿงช wpe-wk2
โœ… ๐Ÿงช webkitperl โœ… ๐Ÿงช ios-wk2 โœ… ๐Ÿงช api-mac โœ… ๐Ÿงช api-wpe
โŒ ๐Ÿงช ios-wk2-wpt โœ… ๐Ÿงช mac-wk1 โณ ๐Ÿ›  wpe-skia
โœ… ๐Ÿงช api-ios โœ… ๐Ÿงช mac-wk2 โœ… ๐Ÿ›  gtk
โœ… ๐Ÿ›  tv โœ… ๐Ÿงช mac-AS-debug-wk2 โœ… ๐Ÿงช gtk-wk2
โœ… ๐Ÿ›  tv-sim โœ… ๐Ÿงช mac-wk2-stress โœ… ๐Ÿงช api-gtk
โœ… ๐Ÿ›  watch
โœ… ๐Ÿ›  watch-sim

lukewarlow avatar Apr 29 '24 17:04 lukewarlow

WPT export at https://github.com/web-platform-tests/wpt/pull/46185

lukewarlow avatar May 09 '24 13:05 lukewarlow

Scheduled perf A/B testing.

rniwa avatar May 13 '24 21:05 rniwa

Perf results look good!

rniwa avatar May 14 '24 22:05 rniwa

Other than the perf aspect does this all look good to you?

lukewarlow avatar May 15 '24 10:05 lukewarlow

Committed 279313@main (3b35a19d0a91): https://commits.webkit.org/279313@main

Reviewed commits have been landed. Closing PR #27880 and removing active labels.

webkit-commit-queue avatar May 25 '24 10:05 webkit-commit-queue