Index: Source/core/dom/Node.h |
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h |
index ce640b4aed7c0107c9099dcd0517d0ac70177769..80501b0d12ae1841fd881158d2a421bddeebf534 100644 |
--- a/Source/core/dom/Node.h |
+++ b/Source/core/dom/Node.h |
@@ -912,6 +912,16 @@ inline bool shouldRecalcStyle(StyleRecalcChange change, const Node* node) |
return change >= Inherit || node->childNeedsStyleRecalc() || node->needsStyleRecalc(); |
} |
+inline bool isTreeScopeRoot(const Node* node) |
+{ |
+ return !node || node->isDocumentNode() || node->isShadowRoot(); |
+} |
+ |
+inline bool isTreeScopeRoot(const Node& node) |
+{ |
+ return node.isDocumentNode() || node.isShadowRoot(); |
+} |
+ |
// Allow equality comparisons of Nodes by reference or pointer, interchangeably. |
inline bool operator==(const Node& a, const Node& b) { return &a == &b; } |
inline bool operator==(const Node& a, const Node* b) { return &a == b; } |