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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.h

Issue 23567016: Have ScopedStyleResolver deal with ContainerNode references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | Source/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ScopedStyleResolver.h
diff --git a/Source/core/css/resolver/ScopedStyleResolver.h b/Source/core/css/resolver/ScopedStyleResolver.h
index fa061336606da592aa052a643f8e401d77aadcc7..f6c5ff3bb1f9f162fe3c9087b8cd37160b96ea19 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.h
+++ b/Source/core/css/resolver/ScopedStyleResolver.h
@@ -50,12 +50,12 @@ class StyleSheetContents;
class ScopedStyleResolver {
WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode* scopingNode) { return adoptPtr(new ScopedStyleResolver(scopingNode)); }
+ static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode& scopingNode) { return adoptPtr(new ScopedStyleResolver(scopingNode)); }
static const ContainerNode* scopingNodeFor(const CSSStyleSheet*);
- const ContainerNode* scopingNode() const { return m_scopingNode; }
- const TreeScope* treeScope() const { return m_scopingNode->treeScope(); }
+ const ContainerNode& scopingNode() const { return m_scopingNode; }
+ const TreeScope* treeScope() const { return m_scopingNode.treeScope(); }
void prepareEmptyRuleSet() { m_authorStyle = RuleSet::create(); }
void setParent(ScopedStyleResolver* newParent) { m_parent = newParent; }
ScopedStyleResolver* parent() { return m_parent; }
@@ -79,13 +79,12 @@ public:
void collectViewportRulesTo(StyleResolver*) const;
private:
- ScopedStyleResolver() : m_scopingNode(0), m_parent(0) { }
- ScopedStyleResolver(const ContainerNode* scopingNode) : m_scopingNode(scopingNode), m_parent(0) { }
+ explicit ScopedStyleResolver(const ContainerNode& scopingNode) : m_scopingNode(scopingNode), m_parent(0) { }
RuleSet* ensureAtHostRuleSetFor(const ShadowRoot*);
RuleSet* atHostRuleSetFor(const ShadowRoot*) const;
- const ContainerNode* m_scopingNode;
+ const ContainerNode& m_scopingNode;
ScopedStyleResolver* m_parent;
OwnPtr<RuleSet> m_authorStyle;
@@ -100,9 +99,9 @@ class ScopedStyleTree {
public:
ScopedStyleTree() : m_scopedResolverForDocument(0), m_buildInDocumentOrder(true) { }
- ScopedStyleResolver* ensureScopedStyleResolver(const ContainerNode* scopingNode);
- ScopedStyleResolver* scopedStyleResolverFor(const ContainerNode* scopingNode);
- ScopedStyleResolver* addScopedStyleResolver(const ContainerNode* scopingNode, bool& isNewEntry);
+ ScopedStyleResolver* ensureScopedStyleResolver(const ContainerNode& scopingNode);
+ ScopedStyleResolver* scopedStyleResolverFor(const ContainerNode& scopingNode);
+ ScopedStyleResolver* addScopedStyleResolver(const ContainerNode& scopingNode, bool& isNewEntry);
void clear();
// for fast-path.
@@ -116,8 +115,8 @@ public:
void remove(const ContainerNode* scopingNode);
- void pushStyleCache(const ContainerNode* scopingNode, const ContainerNode* parent);
- void popStyleCache(const ContainerNode* scopingNode);
+ void pushStyleCache(const ContainerNode& scopingNode, const ContainerNode* parent);
+ void popStyleCache(const ContainerNode& scopingNode);
void collectFeaturesTo(RuleFeatureSet& features);
void setBuildInDocumentOrder(bool enabled) { m_buildInDocumentOrder = enabled; }
« no previous file with comments | « no previous file | Source/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698