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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/ElementShadow.h

Issue 1413583002: Make ElementShadow::youngestShadowRoot() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more tail -> head Created 5 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
Index: third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
index 14f777d9a7cb654d11d5b3e6cebc655324e52aec..e55b0cbea158533e3b9706ff767058bb6f59ba39 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
+++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.h
@@ -47,7 +47,7 @@ public:
~ElementShadow();
Element* host() const;
- ShadowRoot* youngestShadowRoot() const { return m_shadowRoots.head(); }
+ ShadowRoot& youngestShadowRoot() const { ASSERT(m_shadowRoots.head()); return *m_shadowRoots.head(); }
ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); }
ElementShadow* containingShadow() const;
@@ -106,7 +106,7 @@ private:
inline Element* ElementShadow::host() const
{
ASSERT(!m_shadowRoots.isEmpty());
- return youngestShadowRoot()->host();
+ return youngestShadowRoot().host();
}
inline ShadowRoot* Node::youngestShadowRoot() const
@@ -119,7 +119,7 @@ inline ShadowRoot* Node::youngestShadowRoot() const
inline ShadowRoot* Element::youngestShadowRoot() const
{
if (ElementShadow* shadow = this->shadow())
- return shadow->youngestShadowRoot();
+ return &shadow->youngestShadowRoot();
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698