diff options
Diffstat (limited to 'Source/WebCore/dom/ComposedShadowTreeWalker.h')
-rw-r--r-- | Source/WebCore/dom/ComposedShadowTreeWalker.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/WebCore/dom/ComposedShadowTreeWalker.h b/Source/WebCore/dom/ComposedShadowTreeWalker.h index 831b82c69..bb9f41671 100644 --- a/Source/WebCore/dom/ComposedShadowTreeWalker.h +++ b/Source/WebCore/dom/ComposedShadowTreeWalker.h @@ -59,8 +59,6 @@ public: void previousSibling(); void parent(); - // This function ignores policy and always crosses an upper boundary. - void parentIncludingInsertionPointAndShadowRoot(); void next(); void previous(); @@ -81,7 +79,7 @@ private: ASSERT(!m_node->isShadowRoot()); else ASSERT(!m_node->isShadowRoot() || toShadowRoot(m_node)->isYoungest()); - ASSERT(!isInsertionPoint(m_node) || !toInsertionPoint(m_node)->isActive()); + ASSERT(!isActiveInsertionPoint(m_node)); #endif } @@ -100,7 +98,6 @@ private: Node* traverseLastChild(const Node*) const; Node* traverseChild(const Node*, TraversalDirection) const; Node* traverseParent(const Node*) const; - Node* traverseParentIncludingInsertionPointAndShadowRoot(const Node*) const; static Node* traverseNextSibling(const Node*); static Node* traversePreviousSibling(const Node*); @@ -119,6 +116,18 @@ private: Policy m_policy; }; +// A special walker class which is only used for traversing a parent node, including +// insertion points and shadow roots. +class ComposedShadowTreeParentWalker { +public: + ComposedShadowTreeParentWalker(const Node*); + void parentIncludingInsertionPointAndShadowRoot(); + Node* get() const { return const_cast<Node*>(m_node); } +private: + Node* traverseParentIncludingInsertionPointAndShadowRoot(const Node*) const; + const Node* m_node; +}; + } // namespace #endif |