⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295436 in webkit


Ignore:
Timestamp:
Jun 9, 2022, 2:36:44 PM (4 years ago)
Author:
Claudio Saavedra
Message:

Fix invalid isInShadowRoot flag during input element removal
https://bugs.webkit.org/show_bug.cgi?id=241470

Reviewed by Ryosuke Niwa.

Style invalidation of input elements might rely on whether the element
is in the shadow tree, but during node removal the isInShadowRoot flag
might not be up-to-date. Ensure that the flag is updated by
letting Node::removedFromAncestor() be called up first in the
HTMLInputNode::removedFromAncestor() implementation, before
doing anything else with the node post-removal.

  • Source/WebCore/html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::removedFromAncestor):

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r295270 r295436  
    15861586void HTMLInputElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree)
    15871587{
     1588    HTMLTextFormControlElement::removedFromAncestor(removalType, oldParentOfRemovedTree);
    15881589    if (removalType.treeScopeChanged && isRadioButton())
    15891590        oldParentOfRemovedTree.treeScope().radioButtonGroups().removeButton(*this);
     
    15941595        m_hasPendingUserAgentShadowTreeUpdate = false;
    15951596    }
    1596     HTMLTextFormControlElement::removedFromAncestor(removalType, oldParentOfRemovedTree);
    15971597    ASSERT(!isConnected());
    15981598    if (removalType.disconnectedFromDocument && !form() && isRadioButton())
Note: See TracChangeset for help on using the changeset viewer.