[webkit-changes] [WebKit/WebKit] 365ed2: Introduce & deploy insertChildrenBeforeWithoutPreI...

Ryosuke Niwa noreply at github.com
Mon Jan 29 20:49:10 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 365ed2587eaf9a02eea28caa44ca87e60882391d
      https://github.com/WebKit/WebKit/commit/365ed2587eaf9a02eea28caa44ca87e60882391d
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    A LayoutTests/fast/dom/ChildNode-before-self-expected.txt
    A LayoutTests/fast/dom/ChildNode-before-self.html
    A LayoutTests/fast/dom/ParentNode-append-fragments-expected.html
    A LayoutTests/fast/dom/ParentNode-append-fragments.html
    M Source/WebCore/dom/ContainerNode.cpp
    M Source/WebCore/dom/ContainerNode.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/dom/Node.h

  Log Message:
  -----------
  Introduce & deploy insertChildrenBeforeWithoutPreInsertionValidityCheck
https://bugs.webkit.org/show_bug.cgi?id=268206

Reviewed by Wenson Hsieh.

This PR refactors out ensurePreInsertionValidityForPhantomDocumentFragment and
insertChildrenBeforeWithoutPreInsertionValidityCheck and deploy them in ContainerNode's
append, prepend, and replaceChildren functions, and Node's before and after functions.

In addition, this PR adds two new tests for bugs that were caught incidentally by some
other tests during the development.

* LayoutTests/fast/dom/ChildNode-before-self-expected.txt: Added.
* LayoutTests/fast/dom/ChildNode-before-self.html: Added.
* LayoutTests/fast/dom/ParentNode-append-fragments-expected.html: Added.
* LayoutTests/fast/dom/ParentNode-append-fragments.html: Added.
* Source/WebCore/dom/ContainerNode.cpp:
(WebCore::ContainerNode::ensurePreInsertionValidityForPhantomDocumentFragment):
(WebCore::ContainerNode::insertChildrenBeforeWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
(WebCore::ContainerNode::replaceChildren):
* Source/WebCore/dom/ContainerNode.h:
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNodeVector):
(WebCore::Node::before):
(WebCore::Node::after):
* Source/WebCore/dom/Node.h:

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




More information about the webkit-changes mailing list