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

Side by Side Diff: Source/core/css/resolver/ScopedStyleResolver.h

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 public: 65 public:
66 bool checkRegionStyle(Element*); 66 bool checkRegionStyle(Element*);
67 const StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* anima tionName); 67 const StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* anima tionName);
68 void addKeyframeStyle(PassRefPtr<StyleRuleKeyframes>); 68 void addKeyframeStyle(PassRefPtr<StyleRuleKeyframes>);
69 69
70 void matchHostRules(ElementRuleCollector&, bool includeEmptyRules); 70 void matchHostRules(ElementRuleCollector&, bool includeEmptyRules);
71 void matchAuthorRules(ElementRuleCollector&, bool includeEmptyRules, bool ap plyAuthorStyles); 71 void matchAuthorRules(ElementRuleCollector&, bool includeEmptyRules, bool ap plyAuthorStyles);
72 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, bool applyAuthorStyles, CascadeScope, CascadeOrder = ignoreCascadeOrder); 72 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, bool applyAuthorStyles, CascadeScope, CascadeOrder = ignoreCascadeOrder);
73 void matchPageRules(PageRuleCollector&); 73 void matchPageRules(PageRuleCollector&);
74 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, Styl eResolver*); 74 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, Styl eResolver*, bool viewportRuleIsProcessed);
75 void addHostRule(StyleRuleHost*, bool hasDocumentSecurityOrigin, const Conta inerNode* scopingNode); 75 void addHostRule(StyleRuleHost*, bool hasDocumentSecurityOrigin, const Conta inerNode* scopingNode);
76 void addViewportRule(StyleRuleViewport*);
76 void collectFeaturesTo(RuleFeatureSet&); 77 void collectFeaturesTo(RuleFeatureSet&);
77 void resetAuthorStyle(); 78 void resetAuthorStyle();
78 void resetAtHostRules(const ShadowRoot*); 79 void resetAtHostRules(const ShadowRoot*);
79 void collectViewportRulesTo(StyleResolver*) const; 80 void collectViewportRulesTo(StyleResolver*) const;
80 81
81 private: 82 private:
82 explicit ScopedStyleResolver(const ContainerNode& scopingNode) : m_scopingNo de(scopingNode), m_parent(0) { } 83 explicit ScopedStyleResolver(const ContainerNode& scopingNode) : m_scopingNo de(scopingNode), m_parent(0) { }
83 84
84 RuleSet* ensureAtHostRuleSetFor(const ShadowRoot*); 85 RuleSet* ensureAtHostRuleSetFor(const ShadowRoot*);
85 RuleSet* atHostRuleSetFor(const ShadowRoot*) const; 86 RuleSet* atHostRuleSetFor(const ShadowRoot*) const;
87 RuleSet* ensureAuthorStyle();
86 88
87 const ContainerNode& m_scopingNode; 89 const ContainerNode& m_scopingNode;
88 ScopedStyleResolver* m_parent; 90 ScopedStyleResolver* m_parent;
89 91
90 OwnPtr<RuleSet> m_authorStyle; 92 OwnPtr<RuleSet> m_authorStyle;
91 HashMap<const ShadowRoot*, OwnPtr<RuleSet> > m_atHostRules; 93 HashMap<const ShadowRoot*, OwnPtr<RuleSet> > m_atHostRules;
92 94
93 typedef HashMap<const StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRul eMap; 95 typedef HashMap<const StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRul eMap;
94 KeyframesRuleMap m_keyframesRuleMap; 96 KeyframesRuleMap m_keyframesRuleMap;
95 }; 97 };
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 { 161 {
160 if (!cacheIsValid(element)) 162 if (!cacheIsValid(element))
161 resolveStyleCache(element); 163 resolveStyleCache(element);
162 164
163 return m_cache.scopedResolver; 165 return m_cache.scopedResolver;
164 } 166 }
165 167
166 } // namespace WebCore 168 } // namespace WebCore
167 169
168 #endif // ScopedStyleResolver_h 170 #endif // ScopedStyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698