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 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 | 48 |
| 49 class CSSFontSelector; | 49 class CSSFontSelector; |
| 50 class CSSStyleSheet; | 50 class CSSStyleSheet; |
| 51 class Node; | 51 class Node; |
| 52 class RuleFeatureSet; | 52 class RuleFeatureSet; |
| 53 class ShadowTreeStyleSheetCollection; | 53 class ShadowTreeStyleSheetCollection; |
| 54 class StyleRuleFontFace; | 54 class StyleRuleFontFace; |
| 55 class StyleSheet; | 55 class StyleSheet; |
| 56 class StyleSheetContents; | 56 class StyleSheetContents; |
| 57 | 57 |
| 58 enum ShadowCascadeOrder { | |
| 59 ShadowCascadeNone = 0, | |
|
rune
2016/03/22 08:57:07
Enums start at 0 if not specified, so the explicit
kochi
2016/03/22 09:36:26
Done.
| |
| 60 ShadowCascadeV0, | |
| 61 ShadowCascadeV1 | |
| 62 }; | |
| 63 | |
| 58 class CORE_EXPORT StyleEngine final : public NoBaseWillBeGarbageCollectedFinaliz ed<StyleEngine>, public CSSFontSelectorClient { | 64 class CORE_EXPORT StyleEngine final : public NoBaseWillBeGarbageCollectedFinaliz ed<StyleEngine>, public CSSFontSelectorClient { |
| 59 USING_FAST_MALLOC_WILL_BE_REMOVED(StyleEngine); | 65 USING_FAST_MALLOC_WILL_BE_REMOVED(StyleEngine); |
| 60 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StyleEngine); | 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StyleEngine); |
| 61 public: | 67 public: |
| 62 | 68 |
| 63 class IgnoringPendingStylesheet : public TemporaryChange<bool> { | 69 class IgnoringPendingStylesheet : public TemporaryChange<bool> { |
| 64 DISALLOW_NEW(); | 70 DISALLOW_NEW(); |
| 65 public: | 71 public: |
| 66 IgnoringPendingStylesheet(StyleEngine& engine) | 72 IgnoringPendingStylesheet(StyleEngine& engine) |
| 67 : TemporaryChange<bool>(engine.m_ignorePendingStylesheets, true) | 73 : TemporaryChange<bool>(engine.m_ignorePendingStylesheets, true) |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 void attributeChangedForElement(const QualifiedName& attributeName, Element& ); | 177 void attributeChangedForElement(const QualifiedName& attributeName, Element& ); |
| 172 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&); | 178 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&); |
| 173 void pseudoStateChangedForElement(CSSSelector::PseudoType, Element&); | 179 void pseudoStateChangedForElement(CSSSelector::PseudoType, Element&); |
| 174 | 180 |
| 175 unsigned styleForElementCount() const { return m_styleForElementCount; } | 181 unsigned styleForElementCount() const { return m_styleForElementCount; } |
| 176 void incStyleForElementCount() { m_styleForElementCount++; } | 182 void incStyleForElementCount() { m_styleForElementCount++; } |
| 177 | 183 |
| 178 StyleResolverStats* stats() { return m_styleResolverStats.get(); } | 184 StyleResolverStats* stats() { return m_styleResolverStats.get(); } |
| 179 void setStatsEnabled(bool); | 185 void setStatsEnabled(bool); |
| 180 | 186 |
| 187 ShadowCascadeOrder shadowCascadeOrder() const { return m_shadowCascadeOrder; } | |
| 188 void setShadowCascadeOrder(ShadowCascadeOrder); | |
| 189 | |
| 181 DECLARE_VIRTUAL_TRACE(); | 190 DECLARE_VIRTUAL_TRACE(); |
| 182 | 191 |
| 183 private: | 192 private: |
| 184 // CSSFontSelectorClient implementation. | 193 // CSSFontSelectorClient implementation. |
| 185 void fontsNeedUpdate(CSSFontSelector*) override; | 194 void fontsNeedUpdate(CSSFontSelector*) override; |
| 186 | 195 |
| 187 private: | 196 private: |
| 188 StyleEngine(Document&); | 197 StyleEngine(Document&); |
| 189 | 198 |
| 190 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); | 199 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 String m_selectedStylesheetSetName; | 254 String m_selectedStylesheetSetName; |
| 246 | 255 |
| 247 bool m_usesSiblingRules = false; | 256 bool m_usesSiblingRules = false; |
| 248 bool m_usesFirstLineRules = false; | 257 bool m_usesFirstLineRules = false; |
| 249 bool m_usesWindowInactiveSelector = false; | 258 bool m_usesWindowInactiveSelector = false; |
| 250 bool m_usesRemUnits = false; | 259 bool m_usesRemUnits = false; |
| 251 unsigned m_maxDirectAdjacentSelectors = 0; | 260 unsigned m_maxDirectAdjacentSelectors = 0; |
| 252 | 261 |
| 253 bool m_ignorePendingStylesheets = false; | 262 bool m_ignorePendingStylesheets = false; |
| 254 bool m_didCalculateResolver = false; | 263 bool m_didCalculateResolver = false; |
| 264 | |
| 265 ShadowCascadeOrder m_shadowCascadeOrder = ShadowCascadeNone; | |
| 266 | |
| 255 OwnPtrWillBeMember<StyleResolver> m_resolver; | 267 OwnPtrWillBeMember<StyleResolver> m_resolver; |
| 256 StyleInvalidator m_styleInvalidator; | 268 StyleInvalidator m_styleInvalidator; |
| 257 | 269 |
| 258 RefPtrWillBeMember<CSSFontSelector> m_fontSelector; | 270 RefPtrWillBeMember<CSSFontSelector> m_fontSelector; |
| 259 | 271 |
| 260 WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents>> m_te xtToSheetCache; | 272 WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents>> m_te xtToSheetCache; |
| 261 WillBeHeapHashMap<RawPtrWillBeMember<StyleSheetContents>, AtomicString> m_sh eetToTextCache; | 273 WillBeHeapHashMap<RawPtrWillBeMember<StyleSheetContents>, AtomicString> m_sh eetToTextCache; |
| 262 | 274 |
| 263 OwnPtr<StyleResolverStats> m_styleResolverStats; | 275 OwnPtr<StyleResolverStats> m_styleResolverStats; |
| 264 unsigned m_styleForElementCount = 0; | 276 unsigned m_styleForElementCount = 0; |
| 265 | 277 |
| 266 friend class StyleEngineTest; | 278 friend class StyleEngineTest; |
| 267 }; | 279 }; |
| 268 | 280 |
| 269 } // namespace blink | 281 } // namespace blink |
| 270 | 282 |
| 271 #endif | 283 #endif |
| OLD | NEW |