Index: Source/core/dom/shadow/ElementShadow.cpp |
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp |
index 158addd3d0da4180463f8863a020789d291d6a10..94343c5c99181b7d2af2a4ea0ec823cd4a82241d 100644 |
--- a/Source/core/dom/shadow/ElementShadow.cpp |
+++ b/Source/core/dom/shadow/ElementShadow.cpp |
@@ -131,7 +131,7 @@ ElementShadow::~ElementShadow() |
removeAllShadowRoots(); |
} |
-ShadowRoot* ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType type) |
+ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType type) |
{ |
RefPtr<ShadowRoot> shadowRoot = ShadowRoot::create(&shadowHost.document(), type); |
@@ -149,7 +149,9 @@ ShadowRoot* ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow |
shadowHost.didAddShadowRoot(*shadowRoot); |
InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); |
- return shadowRoot.get(); |
+ ASSERT(m_shadowRoots.head()); |
+ ASSERT(shadowRoot.get() == m_shadowRoots.head()); |
+ return *m_shadowRoots.head(); |
} |
void ElementShadow::removeAllShadowRoots() |