Skip to content
  • antti@apple.com's avatar
    <https://webkit.org/b/119886> PseudoElement is abusing parent node pointer · fe1eb0a7
    antti@apple.com authored
    Reviewed by Darin Adler.
    
    PseudoElement sets its host node as its parent. This is confusing and wrong as it breaks
    the basic tree consistency (a node is a child node of its parent node).
            
    This patch adds an explicit host pointer PseudoElement and switches the call sites over. Memory
    impact is negligible as there are not that many ::befores and ::afters.
    
    * dom/ComposedShadowTreeWalker.cpp:
    (WebCore::ComposedShadowTreeWalker::traverseParent):
    * dom/EventPathWalker.cpp:
    (WebCore::EventPathWalker::moveToParent):
    * dom/EventRetargeter.h:
    (WebCore::EventRetargeter::eventTargetRespectingTargetRules):
    * dom/Node.cpp:
    (WebCore::Node::~Node):
            
        Add consistency assertions. Remove unnecessary clearing of sibling pointers. They should be cleared already.
    
    (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc):
    * dom/PseudoElement.cpp:
    (WebCore::PseudoElement::PseudoElement):
    (WebCore::PseudoElement::customStyleForRenderer):
    * dom/PseudoElement.h:
    (WebCore::toPseudoElement):
            
        Add casting functions.
    
    * inspector/InspectorLayerTreeAgent.cpp:
    (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
    * rendering/HitTestResult.cpp:
    (WebCore::HitTestResult::setInnerNode):
    (WebCore::HitTestResult::setInnerNonSharedNode):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    fe1eb0a7