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

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

Issue 54543011: Have StyleResolverParentPusher / SelectorFilter deal with references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/css/resolver/StyleResolver.cpp ('k') | no next file » | 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 30d660fdd46a83bb9ff2393035101af091732607..24d7951ce9b05d70bf4eea37a1c1e7a7092464ba 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -110,7 +110,7 @@ using namespace XMLNames;
class StyleResolverParentPusher {
public:
- StyleResolverParentPusher(Element* parent)
+ explicit StyleResolverParentPusher(Element& parent)
: m_parent(parent)
, m_pushedStyleResolver(0)
{
@@ -119,7 +119,7 @@ public:
{
if (m_pushedStyleResolver)
return;
- m_pushedStyleResolver = m_parent->document().styleResolver();
+ m_pushedStyleResolver = m_parent.document().styleResolver();
m_pushedStyleResolver->pushParentElement(m_parent);
}
~StyleResolverParentPusher()
@@ -130,15 +130,15 @@ public:
// This tells us that our pushed style selector is in a bad state,
// so we should just bail out in that scenario.
- ASSERT(m_pushedStyleResolver == m_parent->document().styleResolver());
- if (m_pushedStyleResolver != m_parent->document().styleResolver())
+ ASSERT(m_pushedStyleResolver == m_parent.document().styleResolver());
+ if (m_pushedStyleResolver != m_parent.document().styleResolver())
return;
m_pushedStyleResolver->popParentElement(m_parent);
}
private:
- Element* m_parent;
+ Element& m_parent;
StyleResolver* m_pushedStyleResolver;
};
@@ -1370,7 +1370,7 @@ void Element::attach(const AttachContext& context)
{
ASSERT(document().inStyleRecalc());
- StyleResolverParentPusher parentPusher(this);
+ StyleResolverParentPusher parentPusher(*this);
// We've already been through detach when doing a lazyAttach, but we might
// need to clear any state that's been added since then.
@@ -1597,7 +1597,7 @@ void Element::recalcChildStyle(StyleRecalcChange change)
{
ASSERT(document().inStyleRecalc());
- StyleResolverParentPusher parentPusher(this);
+ StyleResolverParentPusher parentPusher(*this);
for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
if (shouldRecalcStyle(change, root)) {
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698