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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 759663003: Only allow one shadowRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review. Created 6 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 | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index b0b9340fb288705a4b994b8aa203a467f6c2c158..7cb85c47be175f80c235353cded265ef4be8b1f0 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -967,7 +967,7 @@ void Element::recalcChildStyle(StyleRecalcChange change)
ASSERT(!needsStyleRecalc());
if (change > Inherit || childNeedsStyleRecalc()) {
- for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
+ if (ShadowRoot* root = shadowRoot()) {
if (root->shouldCallRecalcStyle(change))
root->recalcStyle(change);
}
@@ -1049,8 +1049,12 @@ CustomElementDefinition* Element::customElementDefinition() const
return 0;
}
-PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState)
+// TODO(esprehn): Implement the sky spec where shadow roots are a custom
+// element registration feature.
+PassRefPtr<ShadowRoot> Element::ensureShadowRoot(ExceptionState& exceptionState)
{
+ if (ShadowRoot* root = shadowRoot())
+ return root;
return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this));
}
@@ -1059,7 +1063,7 @@ ShadowRoot* Element::shadowRoot() const
ElementShadow* elementShadow = shadow();
if (!elementShadow)
return 0;
- return elementShadow->youngestShadowRoot();
+ return elementShadow->shadowRoot();
}
void Element::childrenChanged(const ChildrenChange& change)
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698