[webkit-changes] [WebKit/WebKit] 272d45: Clear UserActionElement state for the node when it...

Chirag Shah noreply at github.com
Fri May 19 13:33:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 272d45367b3566bd8836ec791248c6916710fc04
      https://github.com/WebKit/WebKit/commit/272d45367b3566bd8836ec791248c6916710fc04
  Author: Chirag M Shah <chirag_m_shah at apple.com>
  Date:   2023-05-19 (Fri, 19 May 2023)

  Changed paths:
    A LayoutTests/fast/html/element-moving-to-new-document-crash-expected.txt
    A LayoutTests/fast/html/element-moving-to-new-document-crash.html
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/UserActionElementSet.cpp
    M Source/WebCore/dom/UserActionElementSet.h

  Log Message:
  -----------
  Clear UserActionElement state for the node when it is moved from the Document to a different one
https://bugs.webkit.org/show_bug.cgi?id=253012
rdar://105876245

Reviewed by Ryosuke Niwa.

Before this change, when an element was moved from oldDocument to
newDocument, and we had UserActionElementSet state for it, we never
cleared that. This meant that the element was still marked to have this
state, which the newDocument doesn't know about. This change fixes
that.

* LayoutTests/fast/html/element-moving-to-new-document-crash-expected.txt: Added.
* LayoutTests/fast/html/element-moving-to-new-document-crash.html: Added.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* Source/WebCore/dom/UserActionElementSet.cpp:
(WebCore::UserActionElementSet::clear):
* Source/WebCore/dom/UserActionElementSet.h:
(WebCore::UserActionElementSet::clearAllForElement):

Originally-landed-as: 259548.353 at safari-7615-branch (b82284c1f8c5). rdar://105876245
Canonical link: https://commits.webkit.org/264272@main




More information about the webkit-changes mailing list