[webkit-changes] [WebKit/WebKit] be4cdc: Implement further enforcement of Trusted Types for...

Luke Warlow noreply at github.com
Wed May 22 04:09:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: be4cdc9c602803f8505921b2c66f86aa0f392497
      https://github.com/WebKit/WebKit/commit/be4cdc9c602803f8505921b2c66f86aa0f392497
  Author: Luke Warlow <lwarlow at igalia.com>
  Date:   2024-05-22 (Wed, 22 May 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/trusted-types/modify-attributes-in-callback-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/trusted-types/modify-attributes-in-callback.html
    M Source/WebCore/dom/Attr.cpp
    M Source/WebCore/dom/Attr.h
    M Source/WebCore/dom/CharacterData.cpp
    M Source/WebCore/dom/CharacterData.h
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/dom/Node.h

  Log Message:
  -----------
  Implement further enforcement of Trusted Types for Attributes
https://bugs.webkit.org/show_bug.cgi?id=274267

Reviewed by Ryosuke Niwa.

This patch adds trusted types enforcement to Attr textContent, value and nodeValue.

It also improves error handling for mutating attributes within default policy.

* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/modify-attributes-in-callback-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/modify-attributes-in-callback.html:
* Source/WebCore/dom/Attr.cpp:
(WebCore::Attr::setValue):
(WebCore::Attr::setNodeValue):
* Source/WebCore/dom/Attr.h:
* Source/WebCore/dom/CharacterData.cpp:
(WebCore::CharacterData::setNodeValue):
* Source/WebCore/dom/CharacterData.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::validateAttributeIndex const):
(WebCore::Element::setAttribute):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::setNodeValue):
(WebCore::Node::setTextContent):
* Source/WebCore/dom/Node.h:

Canonical link: https://commits.webkit.org/279118@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list