Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: Source/core/dom/Element.cpp

Issue 27513004: Make ElementRareData::ensureShadow() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/ElementRareData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698