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

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

Issue 418833002: Remove all members in ScopedStyleTree for preparing class removal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ifdef destructor Created 6 years, 5 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
Index: Source/core/css/resolver/ScopedStyleTree.h
diff --git a/Source/core/css/resolver/ScopedStyleTree.h b/Source/core/css/resolver/ScopedStyleTree.h
index 2944ec6ab118dd14414dee326e14daaa8f321317..0918be3c34bedc631cd49f57a8cff779f01aa145 100644
--- a/Source/core/css/resolver/ScopedStyleTree.h
+++ b/Source/core/css/resolver/ScopedStyleTree.h
@@ -39,71 +39,17 @@ class ScopedStyleTree {
DISALLOW_ALLOCATION();
public:
ScopedStyleTree();
- ~ScopedStyleTree();
-
- ScopedStyleResolver* ensureScopedStyleResolver(ContainerNode& scopingNode);
-
- ScopedStyleResolver* scopedStyleResolverFor(const ContainerNode& scopingNode);
-
- // for fast-path.
- bool hasOnlyScopedResolverForDocument() const { return m_authorStyles.size() == 1; }
void resolveScopedStyles(const Element*, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>&);
void collectScopedResolversForHostedShadowTrees(const Element*, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>&);
void resolveScopedKeyframesRules(const Element*, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>&);
- ScopedStyleResolver* scopedResolverFor(const Element*);
-
- void remove(const ContainerNode* scopingNode);
-
- void pushStyleCache(const ContainerNode& scopingNode, const ContainerNode* parent);
- void popStyleCache(const ContainerNode& scopingNode);
-
- void collectFeaturesTo(RuleFeatureSet& features);
void trace(Visitor*);
private:
- bool cacheIsValid(const ContainerNode* parent) const { return parent && parent == m_cache.nodeForScopedStyles; }
- void resolveStyleCache(const ContainerNode* scopingNode);
- ScopedStyleResolver* enclosingScopedStyleResolverFor(const ContainerNode* scopingNode);
-
- WillBeHeapHashMap<RawPtrWillBeMember<const ContainerNode>, RawPtrWillBeMember<ScopedStyleResolver> > m_authorStyles;
-
- class ScopedStyleCache {
- DISALLOW_ALLOCATION();
- public:
- RawPtrWillBeMember<ScopedStyleResolver> scopedResolver;
- RawPtrWillBeMember<const ContainerNode> nodeForScopedStyles;
-
- ScopedStyleCache()
- : scopedResolver(nullptr)
- , nodeForScopedStyles(nullptr)
- {
- }
-
- void clear()
- {
- scopedResolver = nullptr;
- nodeForScopedStyles = nullptr;
- }
-
- void trace(Visitor* visitor)
- {
- visitor->trace(scopedResolver);
- visitor->trace(nodeForScopedStyles);
- }
- };
- ScopedStyleCache m_cache;
+ ScopedStyleResolver* scopedResolverFor(const Element*);
};
-inline ScopedStyleResolver* ScopedStyleTree::scopedResolverFor(const Element* element)
-{
- if (!cacheIsValid(element))
- resolveStyleCache(element);
-
- return m_cache.scopedResolver;
-}
-
} // namespace blink
#endif // ScopedStyleTree_h

Powered by Google App Engine
This is Rietveld 408576698