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

Unified Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 59463007: Have Element::ensureUserAgentShadowRoot() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Attempt to fix win build Created 7 years, 1 month 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/shadow/ElementShadow.h ('k') | Source/core/html/HTMLDetailsElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9ba060d4200f0b72ce11a57f3cf1679944f7775e 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,8 @@ ShadowRoot* ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow
shadowHost.didAddShadowRoot(*shadowRoot);
InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get());
- return shadowRoot.get();
+ ASSERT(m_shadowRoots.head());
eseidel 2013/11/07 23:30:07 Did you want to ASSERT that m_shadowRoots.head() =
adamk 2013/11/08 00:01:51 The ASSERT you suggest will fail, so it can't be a
Inactive 2013/11/08 15:09:38 Well, I really wanted this assertion because I wan
+ return *m_shadowRoots.head();
}
void ElementShadow::removeAllShadowRoots()
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.h ('k') | Source/core/html/HTMLDetailsElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698