[webkit-changes] [WebKit/WebKit] fa5a06: Range APIs do not construct / move trees in tree o...

Ryosuke Niwa noreply at github.com
Tue Feb 7 17:03:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fa5a06a66c96bc6864e684d9f9f07b115f39c60e
      https://github.com/WebKit/WebKit/commit/fa5a06a66c96bc6864e684d9f9f07b115f39c60e
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-02-07 (Tue, 07 Feb 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors-expected.txt
    M Source/WebCore/dom/CustomElementReactionQueue.cpp
    M Source/WebCore/dom/CustomElementReactionQueue.h
    M Source/WebCore/dom/Range.cpp

  Log Message:
  -----------
  Range APIs do not construct / move trees in tree order (observable by custom elements)
https://bugs.webkit.org/show_bug.cgi?id=188279

Reviewed by Chris Dumez.

In order to match the spec'ed upgrade order, create a nested custom element reaction stack
which is used as a holding tank of upgrade reactions during Range::processContents.

At the end, we traverse the document fragment top-down and re-enqueue each element to the real
custom element reaction stack in the tree order.

* LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors-expected.txt:
* Source/WebCore/dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementQueue::takeElements): Added.
(WebCore::CustomElementReactionQueue::enqueueElementsOnAppropriateElementQueue): Added.
(WebCore::CustomElementReactionStack::takeElements): Added.
* Source/WebCore/dom/CustomElementReactionQueue.h:
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::processContents):

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




More information about the webkit-changes mailing list