[webkit-changes] [WebKit/WebKit] c17719: Add mutation events tests for ContainerNode::repla...

Ryosuke Niwa noreply at github.com
Fri Sep 1 16:13:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c177199a72c0d38878dcffa142e64ffe263e822e
      https://github.com/WebKit/WebKit/commit/c177199a72c0d38878dcffa142e64ffe263e822e
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    A LayoutTests/fast/dom/replace-children-mutation-events-expected.txt
    A LayoutTests/fast/dom/replace-children-mutation-events.html
    M Source/WebCore/dom/ContainerNode.cpp
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/dom/Node.h

  Log Message:
  -----------
  Add mutation events tests for ContainerNode::replaceChildren and refactor the code
https://bugs.webkit.org/show_bug.cgi?id=261016

Reviewed by Chris Dumez.

Added some tests for mutating DOM during replaceChildren's tree mutating operations.

Also refactor the code in ContainerNode::replaceChildren by merging some aspects of
Node::convertNodesOrStringsIntoNode into the function so that all node removal &
insertion the logic will be in one place.

* LayoutTests/fast/dom/replace-children-mutation-events-expected.txt: Added.
* LayoutTests/fast/dom/replace-children-mutation-events.html: Added.
* Source/WebCore/dom/ContainerNode.cpp:
(WebCore::ContainerNode::replaceChildren):
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNodeVector): Extracted from convertNodesOrStringsIntoNode.
(WebCore::Node::convertNodesOrStringsIntoNode):
* Source/WebCore/dom/Node.h:

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




More information about the webkit-changes mailing list