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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.h

Issue 1869773004: Move shadowCascadeOrder to Document from StyleEngine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ASSERT and insert DCHECK_NE Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 class CSSFontSelector; 48 class CSSFontSelector;
49 class CSSStyleSheet; 49 class CSSStyleSheet;
50 class Node; 50 class Node;
51 class RuleFeatureSet; 51 class RuleFeatureSet;
52 class ShadowTreeStyleSheetCollection; 52 class ShadowTreeStyleSheetCollection;
53 class StyleRuleFontFace; 53 class StyleRuleFontFace;
54 class StyleSheet; 54 class StyleSheet;
55 class StyleSheetContents; 55 class StyleSheetContents;
56 56
57 enum ShadowCascadeOrder {
58 ShadowCascadeNone,
59 ShadowCascadeV0,
60 ShadowCascadeV1
61 };
62
63 class CORE_EXPORT StyleEngine final : public GarbageCollectedFinalized<StyleEngi ne>, public CSSFontSelectorClient { 57 class CORE_EXPORT StyleEngine final : public GarbageCollectedFinalized<StyleEngi ne>, public CSSFontSelectorClient {
64 USING_GARBAGE_COLLECTED_MIXIN(StyleEngine); 58 USING_GARBAGE_COLLECTED_MIXIN(StyleEngine);
65 public: 59 public:
66 60
67 class IgnoringPendingStylesheet : public TemporaryChange<bool> { 61 class IgnoringPendingStylesheet : public TemporaryChange<bool> {
68 DISALLOW_NEW(); 62 DISALLOW_NEW();
69 public: 63 public:
70 IgnoringPendingStylesheet(StyleEngine& engine) 64 IgnoringPendingStylesheet(StyleEngine& engine)
71 : TemporaryChange<bool>(engine.m_ignorePendingStylesheets, true) 65 : TemporaryChange<bool>(engine.m_ignorePendingStylesheets, true)
72 { 66 {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 void attributeChangedForElement(const QualifiedName& attributeName, Element& ); 169 void attributeChangedForElement(const QualifiedName& attributeName, Element& );
176 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&); 170 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&);
177 void pseudoStateChangedForElement(CSSSelector::PseudoType, Element&); 171 void pseudoStateChangedForElement(CSSSelector::PseudoType, Element&);
178 172
179 unsigned styleForElementCount() const { return m_styleForElementCount; } 173 unsigned styleForElementCount() const { return m_styleForElementCount; }
180 void incStyleForElementCount() { m_styleForElementCount++; } 174 void incStyleForElementCount() { m_styleForElementCount++; }
181 175
182 StyleResolverStats* stats() { return m_styleResolverStats.get(); } 176 StyleResolverStats* stats() { return m_styleResolverStats.get(); }
183 void setStatsEnabled(bool); 177 void setStatsEnabled(bool);
184 178
185 ShadowCascadeOrder shadowCascadeOrder() const { return m_shadowCascadeOrder; }
186 void setShadowCascadeOrder(ShadowCascadeOrder);
187 bool mayContainV0Shadow() const { return m_mayContainV0Shadow; }
188
189 DECLARE_VIRTUAL_TRACE(); 179 DECLARE_VIRTUAL_TRACE();
190 180
191 private: 181 private:
192 // CSSFontSelectorClient implementation. 182 // CSSFontSelectorClient implementation.
193 void fontsNeedUpdate(CSSFontSelector*) override; 183 void fontsNeedUpdate(CSSFontSelector*) override;
194 184
195 private: 185 private:
196 StyleEngine(Document&); 186 StyleEngine(Document&);
197 187
198 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); 188 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 String m_selectedStylesheetSetName; 243 String m_selectedStylesheetSetName;
254 244
255 bool m_usesSiblingRules = false; 245 bool m_usesSiblingRules = false;
256 bool m_usesFirstLineRules = false; 246 bool m_usesFirstLineRules = false;
257 bool m_usesWindowInactiveSelector = false; 247 bool m_usesWindowInactiveSelector = false;
258 bool m_usesRemUnits = false; 248 bool m_usesRemUnits = false;
259 unsigned m_maxDirectAdjacentSelectors = 0; 249 unsigned m_maxDirectAdjacentSelectors = 0;
260 250
261 bool m_ignorePendingStylesheets = false; 251 bool m_ignorePendingStylesheets = false;
262 bool m_didCalculateResolver = false; 252 bool m_didCalculateResolver = false;
263 bool m_mayContainV0Shadow = false;
264
265 ShadowCascadeOrder m_shadowCascadeOrder = ShadowCascadeNone;
266 253
267 Member<StyleResolver> m_resolver; 254 Member<StyleResolver> m_resolver;
268 StyleInvalidator m_styleInvalidator; 255 StyleInvalidator m_styleInvalidator;
269 256
270 Member<CSSFontSelector> m_fontSelector; 257 Member<CSSFontSelector> m_fontSelector;
271 258
272 HeapHashMap<AtomicString, Member<StyleSheetContents>> m_textToSheetCache; 259 HeapHashMap<AtomicString, Member<StyleSheetContents>> m_textToSheetCache;
273 HeapHashMap<Member<StyleSheetContents>, AtomicString> m_sheetToTextCache; 260 HeapHashMap<Member<StyleSheetContents>, AtomicString> m_sheetToTextCache;
274 261
275 OwnPtr<StyleResolverStats> m_styleResolverStats; 262 OwnPtr<StyleResolverStats> m_styleResolverStats;
276 unsigned m_styleForElementCount = 0; 263 unsigned m_styleForElementCount = 0;
277 264
278 friend class StyleEngineTest; 265 friend class StyleEngineTest;
279 }; 266 };
280 267
281 } // namespace blink 268 } // namespace blink
282 269
283 #endif 270 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698