Index: Source/core/dom/shadow/ShadowRoot.h |
diff --git a/Source/core/dom/shadow/ShadowRoot.h b/Source/core/dom/shadow/ShadowRoot.h |
index 018f8e854d40cee992362ed5f5014bd69f1ca113..c70c0e26e060cb98ab56323c864a16f3ecb933b0 100644 |
--- a/Source/core/dom/shadow/ShadowRoot.h |
+++ b/Source/core/dom/shadow/ShadowRoot.h |
@@ -172,6 +172,12 @@ inline ShadowRoot* toShadowRoot(TreeScope* treeScope) |
return const_cast<ShadowRoot*>(toShadowRoot(static_cast<const TreeScope*>(treeScope))); |
} |
+inline ShadowRoot& toShadowRoot(TreeScope& treeScope) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(treeScope.rootNode() && treeScope.rootNode()->isShadowRoot()); |
+ return static_cast<ShadowRoot&>(treeScope); |
+} |
+ |
} // namespace |
#endif |