Index: Source/core/dom/shadow/ShadowRoot.h |
diff --git a/Source/core/dom/shadow/ShadowRoot.h b/Source/core/dom/shadow/ShadowRoot.h |
index c70c0e26e060cb98ab56323c864a16f3ecb933b0..1ad8bf110816836edd644b3ed5d1d0f9b5009ff7 100644 |
--- a/Source/core/dom/shadow/ShadowRoot.h |
+++ b/Source/core/dom/shadow/ShadowRoot.h |
@@ -161,6 +161,12 @@ inline ShadowRoot* toShadowRoot(Node* node) |
return const_cast<ShadowRoot*>(toShadowRoot(static_cast<const Node*>(node))); |
} |
+inline const ShadowRoot& toShadowRoot(const Node& node) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(node.isShadowRoot()); |
+ return static_cast<const ShadowRoot&>(node); |
+} |
+ |
inline const ShadowRoot* toShadowRoot(const TreeScope* treeScope) |
{ |
ASSERT_WITH_SECURITY_IMPLICATION(!treeScope || (treeScope->rootNode() && treeScope->rootNode()->isShadowRoot())); |