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

Unified Diff: Source/core/css/resolver/StyleResolver.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.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 6cb899635102050c13ccda2b589cfe7f2aed03d4..e1937abcb04e912af834238a87644d8ae814cbd0 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -299,10 +299,9 @@ void StyleResolver::fontsNeedUpdate(FontSelector* fontSelector)
m_document.setNeedsStyleRecalc();
}
-void StyleResolver::pushParentElement(Element* parent)
+void StyleResolver::pushParentElement(Element& parent)
{
- ASSERT(parent);
- const ContainerNode* parentsParent = parent->parentOrShadowHostElement();
+ const ContainerNode* parentsParent = parent.parentOrShadowHostElement();
// We are not always invoked consistently. For example, script execution can cause us to enter
// style recalc in the middle of tree building. We may also be invoked from somewhere within the tree.
@@ -314,18 +313,17 @@ void StyleResolver::pushParentElement(Element* parent)
m_selectorFilter.pushParent(parent);
// Note: We mustn't skip ShadowRoot nodes for the scope stack.
- m_styleTree.pushStyleCache(*parent, parent->parentOrShadowHostNode());
+ m_styleTree.pushStyleCache(parent, parent.parentOrShadowHostNode());
}
-void StyleResolver::popParentElement(Element* parent)
+void StyleResolver::popParentElement(Element& parent)
{
- ASSERT(parent);
// Note that we may get invoked for some random elements in some wacky cases during style resolve.
// Pause maintaining the stack in this case.
- if (m_selectorFilter.parentStackIsConsistent(parent))
+ if (m_selectorFilter.parentStackIsConsistent(&parent))
m_selectorFilter.popParent();
- m_styleTree.popStyleCache(*parent);
+ m_styleTree.popStyleCache(parent);
}
void StyleResolver::pushParentShadowRoot(const ShadowRoot& shadowRoot)
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698