Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index eed37fbb737fe47d67f6dd8263d62a20e9dfca75..583ab8483a72cbdc826ed93f4664abe671ca3749 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -1677,7 +1677,7 @@ ElementShadow* Element::shadow() const |
return hasRareData() ? elementRareData()->shadow() : 0; |
} |
-ElementShadow* Element::ensureShadow() |
+ElementShadow& Element::ensureShadow() |
{ |
return ensureElementRareData()->ensureShadow(); |
} |
@@ -1695,7 +1695,7 @@ PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& es) |
ensureUserAgentShadowRoot(); |
if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) |
- return ensureShadow()->addShadowRoot(this, ShadowRoot::AuthorShadowRoot); |
+ return ensureShadow().addShadowRoot(this, ShadowRoot::AuthorShadowRoot); |
// Since some elements recreates shadow root dynamically, multiple shadow |
// subtrees won't work well in that element. Until they are fixed, we disable |
@@ -1704,7 +1704,7 @@ PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& es) |
es.throwUninformativeAndGenericDOMException(HierarchyRequestError); |
return 0; |
} |
- return ensureShadow()->addShadowRoot(this, ShadowRoot::AuthorShadowRoot); |
+ return ensureShadow().addShadowRoot(this, ShadowRoot::AuthorShadowRoot); |
} |
ShadowRoot* Element::shadowRoot() const |
@@ -1738,7 +1738,7 @@ ShadowRoot* Element::ensureUserAgentShadowRoot() |
{ |
if (ShadowRoot* shadowRoot = userAgentShadowRoot()) |
return shadowRoot; |
- ShadowRoot* shadowRoot = ensureShadow()->addShadowRoot(this, ShadowRoot::UserAgentShadowRoot); |
+ ShadowRoot* shadowRoot = ensureShadow().addShadowRoot(this, ShadowRoot::UserAgentShadowRoot); |
didAddUserAgentShadowRoot(shadowRoot); |
return shadowRoot; |
} |