Chromium Code Reviews| OLD | NEW |
|---|---|
| 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. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 #include "core/animation/PropertyHandle.h" | 27 #include "core/animation/PropertyHandle.h" |
| 28 #include "core/css/ElementRuleCollector.h" | 28 #include "core/css/ElementRuleCollector.h" |
| 29 #include "core/css/PseudoStyleRequest.h" | 29 #include "core/css/PseudoStyleRequest.h" |
| 30 #include "core/css/RuleFeature.h" | 30 #include "core/css/RuleFeature.h" |
| 31 #include "core/css/RuleSet.h" | 31 #include "core/css/RuleSet.h" |
| 32 #include "core/css/SelectorChecker.h" | 32 #include "core/css/SelectorChecker.h" |
| 33 #include "core/css/SelectorFilter.h" | 33 #include "core/css/SelectorFilter.h" |
| 34 #include "core/css/resolver/CSSPropertyPriority.h" | 34 #include "core/css/resolver/CSSPropertyPriority.h" |
| 35 #include "core/css/resolver/MatchedPropertiesCache.h" | 35 #include "core/css/resolver/MatchedPropertiesCache.h" |
| 36 #include "core/css/resolver/StyleBuilder.h" | 36 #include "core/css/resolver/StyleBuilder.h" |
| 37 #include "core/css/resolver/StyleRuleUsageTracker.h" | |
| 37 #include "core/style/CachedUAStyle.h" | 38 #include "core/style/CachedUAStyle.h" |
| 38 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
| 39 #include "wtf/Deque.h" | 40 #include "wtf/Deque.h" |
| 40 #include "wtf/HashMap.h" | 41 #include "wtf/HashMap.h" |
| 41 #include "wtf/HashSet.h" | 42 #include "wtf/HashSet.h" |
| 42 #include "wtf/ListHashSet.h" | 43 #include "wtf/ListHashSet.h" |
| 43 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
| 44 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 | 188 |
| 188 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } | 189 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } |
| 189 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } | 190 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } |
| 190 | 191 |
| 191 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId); | 192 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId); |
| 192 | 193 |
| 193 DECLARE_TRACE(); | 194 DECLARE_TRACE(); |
| 194 | 195 |
| 195 void initWatchedSelectorRules(); | 196 void initWatchedSelectorRules(); |
| 196 | 197 |
| 198 void setRuleUsageTracker(StyleRuleUsageTracker*); | |
| 199 | |
| 197 private: | 200 private: |
| 198 explicit StyleResolver(Document&); | 201 explicit StyleResolver(Document&); |
| 199 | 202 |
| 200 PassRefPtr<ComputedStyle> initialStyleForElement(); | 203 PassRefPtr<ComputedStyle> initialStyleForElement(); |
| 201 | 204 |
| 202 // FIXME: This should probably go away, folded into FontBuilder. | 205 // FIXME: This should probably go away, folded into FontBuilder. |
| 203 void updateFont(StyleResolverState&); | 206 void updateFont(StyleResolverState&); |
| 204 | 207 |
| 208 void addMatchedRulesToTracker(ElementRuleCollector&); | |
|
caseq
2016/10/27 20:59:55
const ElementRuleCollector&
valih
2016/10/27 21:41:16
Done.
| |
| 209 | |
| 205 void loadPendingResources(StyleResolverState&); | 210 void loadPendingResources(StyleResolverState&); |
| 206 void adjustComputedStyle(StyleResolverState&, Element*); | 211 void adjustComputedStyle(StyleResolverState&, Element*); |
| 207 | 212 |
| 208 void appendCSSStyleSheet(CSSStyleSheet&); | 213 void appendCSSStyleSheet(CSSStyleSheet&); |
| 209 | 214 |
| 210 void collectPseudoRulesForElement(const Element&, | 215 void collectPseudoRulesForElement(const Element&, |
| 211 ElementRuleCollector&, | 216 ElementRuleCollector&, |
| 212 PseudoId, | 217 PseudoId, |
| 213 unsigned rulesToInclude); | 218 unsigned rulesToInclude); |
| 214 void matchRuleSet(ElementRuleCollector&, RuleSet*); | 219 void matchRuleSet(ElementRuleCollector&, RuleSet*); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; | 283 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; |
| 279 | 284 |
| 280 // FIXME: The entire logic of collecting features on StyleResolver, as well as | 285 // FIXME: The entire logic of collecting features on StyleResolver, as well as |
| 281 // transferring them between various parts of machinery smells wrong. This | 286 // transferring them between various parts of machinery smells wrong. This |
| 282 // needs to be better somehow. | 287 // needs to be better somehow. |
| 283 RuleFeatureSet m_features; | 288 RuleFeatureSet m_features; |
| 284 Member<RuleSet> m_siblingRuleSet; | 289 Member<RuleSet> m_siblingRuleSet; |
| 285 Member<RuleSet> m_uncommonAttributeRuleSet; | 290 Member<RuleSet> m_uncommonAttributeRuleSet; |
| 286 Member<RuleSet> m_watchedSelectorsRules; | 291 Member<RuleSet> m_watchedSelectorsRules; |
| 287 | 292 |
| 293 Member<StyleRuleUsageTracker> m_tracker; | |
| 294 | |
| 288 bool m_needCollectFeatures; | 295 bool m_needCollectFeatures; |
| 289 bool m_printMediaType; | 296 bool m_printMediaType; |
| 290 bool m_hasFullscreenUAStyle = false; | 297 bool m_hasFullscreenUAStyle = false; |
| 291 | 298 |
| 292 unsigned m_styleSharingDepth; | 299 unsigned m_styleSharingDepth; |
| 293 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> | 300 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> |
| 294 m_styleSharingLists; | 301 m_styleSharingLists; |
| 295 }; | 302 }; |
| 296 | 303 |
| 297 } // namespace blink | 304 } // namespace blink |
| 298 | 305 |
| 299 #endif // StyleResolver_h | 306 #endif // StyleResolver_h |
| OLD | NEW |