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

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

Issue 216283003: Use the StyleResolverParentScope for ShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/css/resolver/StyleResolverParentScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/ShadowRoot.cpp
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 0672fbfc175e734d5927796788f2dffe23d242bc..b620fb260141fdf773ce172af4b45889c7ec262b 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -30,6 +30,7 @@
#include "bindings/v8/ExceptionState.h"
#include "core/css/StyleSheetList.h"
#include "core/css/resolver/StyleResolver.h"
+#include "core/css/resolver/StyleResolverParentScope.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/StyleEngine.h"
#include "core/dom/Text.h"
@@ -140,8 +141,7 @@ void ShadowRoot::recalcStyle(StyleRecalcChange change)
// ShadowRoot doesn't support custom callbacks.
ASSERT(!hasCustomStyleCallbacks());
- StyleResolver& styleResolver = document().ensureStyleResolver();
- styleResolver.pushParentShadowRoot(*this);
+ StyleResolverParentScope parentScope(*this);
if (styleChangeType() >= SubtreeStyleChange)
change = Force;
@@ -166,8 +166,6 @@ void ShadowRoot::recalcStyle(StyleRecalcChange change)
}
}
- styleResolver.popParentShadowRoot(*this);
-
clearChildNeedsStyleRecalc();
}
@@ -197,10 +195,8 @@ void ShadowRoot::setApplyAuthorStyles(bool value)
void ShadowRoot::attach(const AttachContext& context)
{
- StyleResolver& styleResolver = document().ensureStyleResolver();
- styleResolver.pushParentShadowRoot(*this);
+ StyleResolverParentScope parentScope(*this);
DocumentFragment::attach(context);
- styleResolver.popParentShadowRoot(*this);
}
Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* insertionPoint)
« no previous file with comments | « Source/core/css/resolver/StyleResolverParentScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698