Implement trusted types integrations with DOM attribute APIs.#26519
Conversation
|
EWS run on previous version of this PR (hash 44b38f4) Details |
|
EWS run on previous version of this PR (hash 0d8e713) Details |
|
EWS run on previous version of this PR (hash 50bafe9) Details |
|
EWS run on previous version of this PR (hash 7c67e83) Details |
|
I think we need to add WEBCORE_EXPORT to TrustedScript and TrustedScriptURL like we have for TrustedHTML, that should fix the build failure. |
There was a problem hiding this comment.
This index can be stale as getTrustedTypesCompliantAttributeValue can result in JS execution which may mutate the attributes of the element. We need to work out an interopable solution to this.
There was a problem hiding this comment.
As discussed, we will look this at a later stage. The bug is filed at https://bugs.webkit.org/show_bug.cgi?id=272678
|
Perf A/B looks good! |
|
EWS run on previous version of this PR (hash ccd2657) Details |
|
EWS run on previous version of this PR (hash 50c70b8) Details |
|
EWS run on previous version of this PR (hash ce61832) Details |
|
EWS run on previous version of this PR (hash 405cb60) Details |
|
EWS run on current version of this PR (hash 04b9b37) Details |
https://bugs.webkit.org/show_bug.cgi?id=270436 Reviewed by Ryosuke Niwa. Implement the spec updates at whatwg/dom#1247 It also removes some expectations in GTK as the results should be in line with the general expectation file. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-setAttribute-respects-Elements-node-documents-globals-CSP-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/GlobalEventHandlers-onclick-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-metadata.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-setAttribute-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-setAttributeNS-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-event-handlers-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-event-handlers.html: * LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-svg-script-set-href-expected.txt: * LayoutTests/platform/gtk/TestExpectations: * Source/WebCore/dom/Element.cpp: (WebCore::trustedTypesCompliantAttributeValue): (WebCore::Element::validateAttributeIndex const): (WebCore::Element::toggleAttribute): (WebCore::Element::setAttribute): (WebCore::Element::setElementsArrayAttribute): (WebCore::appendAttributes): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::setAttributeNS): * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.idl: * Source/WebCore/dom/TrustedScript.h: * Source/WebCore/dom/TrustedScriptURL.h: (WebCore::TrustedScriptURL::toString const): Deleted. (WebCore::TrustedScriptURL::toJSON const): Deleted. * Source/WebCore/dom/TrustedType.cpp: (WebCore::stringToTrustedType): (WebCore::trustedTypeForAttribute): * Source/WebCore/dom/TrustedType.h: * Source/WebCore/dom/TrustedTypePolicyFactory.cpp: (WebCore::TrustedTypePolicyFactory::getAttributeType const): * Source/WebKit/WebProcess/InjectedBundle/API/mac/WKDOMElement.mm: (-[WKDOMElement setAttribute:value:]): * Source/WebKitLegacy/mac/DOM/DOMElement.mm: (-[DOMElement setAttribute:value:]): (-[DOMElement setAttributeNS:qualifiedName:value:]): Canonical link: https://commits.webkit.org/278817@main
|
Committed 278817@main (9a38b69): https://commits.webkit.org/278817@main Reviewed commits have been landed. Closing PR #26519 and removing active labels. |
🛠 ios-sim
9a38b69
04b9b37