Node* ComposedShadowTreeWalker::traverseParent(const Node* node) const { if (!canCrossUpperBoundary() && node->isShadowRoot()) { ASSERT(toShadowRoot(node)->isYoungest()); return 0; } if (ElementShadow* shadow = shadowOfParent(node)) { if (InsertionPoint* insertionPoint = shadow->insertionPointFor(node)) return traverseParent(insertionPoint); } return traverseParentInCurrentTree(node); }
// FIXME: Use an iterative algorithm so that it can be inlined. // https://bugs.webkit.org/show_bug.cgi?id=90415 Node* ComposedShadowTreeWalker::traverseParent(const Node* node, ParentTraversalDetails* details) const { if (!canCrossUpperBoundary() && node->isShadowRoot()) { ASSERT(toShadowRoot(node)->isYoungest()); return 0; } if (ElementShadow* shadow = shadowOfParent(node)) { shadow->ensureDistribution(); if (InsertionPoint* insertionPoint = resolveReprojection(node)) { if (details) details->didTraverseInsertionPoint(insertionPoint); return traverseParent(insertionPoint, details); } // The node is a non-distributed light child or older shadow's child. if (details) details->childWasOutOfComposition(); } return traverseParentInCurrentTree(node, details); }
// FIXME: Use an iterative algorithm so that it can be inlined. // https://bugs.webkit.org/show_bug.cgi?id=90415 Node* ComposedShadowTreeWalker::traverseParent(const Node* node, ParentTraversalDetails* details) const { if (node->isPseudoElement()) return toPseudoElement(node)->hostElement(); if (!canCrossUpperBoundary() && node->isShadowRoot()) return 0; if (nodeCanBeDistributed(node)) { if (InsertionPoint* insertionPoint = resolveReprojection(node)) { if (details) details->didTraverseInsertionPoint(insertionPoint); return traverseParent(insertionPoint, details); } // The node is a non-distributed light child or older shadow's child. if (details) details->childWasOutOfComposition(); } return traverseParentInCurrentTree(node, details); }