| 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 18 matching lines...) Expand all Loading... |
| 29 #define StyleEngine_h | 29 #define StyleEngine_h |
| 30 | 30 |
| 31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
| 32 #include "core/css/CSSFontSelectorClient.h" | 32 #include "core/css/CSSFontSelectorClient.h" |
| 33 #include "core/css/invalidation/StyleInvalidator.h" | 33 #include "core/css/invalidation/StyleInvalidator.h" |
| 34 #include "core/css/resolver/StyleResolver.h" | 34 #include "core/css/resolver/StyleResolver.h" |
| 35 #include "core/css/resolver/StyleResolverStats.h" | 35 #include "core/css/resolver/StyleResolverStats.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/DocumentOrderedList.h" | 37 #include "core/dom/DocumentOrderedList.h" |
| 38 #include "core/dom/DocumentStyleSheetCollection.h" | 38 #include "core/dom/DocumentStyleSheetCollection.h" |
| 39 #include "core/dom/StyleEngineContext.h" |
| 39 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 40 #include "wtf/Allocator.h" | 41 #include "wtf/Allocator.h" |
| 41 #include "wtf/ListHashSet.h" | 42 #include "wtf/ListHashSet.h" |
| 42 #include "wtf/TemporaryChange.h" | 43 #include "wtf/TemporaryChange.h" |
| 43 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
| 44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class CSSFontSelector; | 49 class CSSFontSelector; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void clearMediaQueryRuleSetStyleSheets(); | 92 void clearMediaQueryRuleSetStyleSheets(); |
| 92 void updateStyleSheetsInImport(DocumentStyleSheetCollector& parentCollector)
; | 93 void updateStyleSheetsInImport(DocumentStyleSheetCollector& parentCollector)
; |
| 93 void updateActiveStyleSheets(StyleResolverUpdateMode); | 94 void updateActiveStyleSheets(StyleResolverUpdateMode); |
| 94 | 95 |
| 95 String preferredStylesheetSetName() const { return m_preferredStylesheetSetN
ame; } | 96 String preferredStylesheetSetName() const { return m_preferredStylesheetSetN
ame; } |
| 96 String selectedStylesheetSetName() const { return m_selectedStylesheetSetNam
e; } | 97 String selectedStylesheetSetName() const { return m_selectedStylesheetSetNam
e; } |
| 97 void setPreferredStylesheetSetNameIfNotSet(const String&); | 98 void setPreferredStylesheetSetNameIfNotSet(const String&); |
| 98 void setSelectedStylesheetSetName(const String&); | 99 void setSelectedStylesheetSetName(const String&); |
| 99 void setHttpDefaultStyle(const String&); | 100 void setHttpDefaultStyle(const String&); |
| 100 | 101 |
| 101 void addPendingSheet(); | 102 void addPendingSheet(StyleEngineContext&); |
| 102 void removePendingSheet(Node* styleSheetCandidateNode); | 103 void removePendingSheet(Node* styleSheetCandidateNode, const StyleEngineCont
ext&); |
| 103 | 104 |
| 104 bool hasPendingSheets() const { return m_pendingStylesheets > 0; } | 105 bool hasPendingSheets() const { return m_pendingStylesheets > 0; } |
| 106 bool hasPendingRenderBlockingSheets() const { return m_pendingRenderBlocking
Stylesheets > 0; } |
| 105 bool haveStylesheetsLoaded() const { return !hasPendingSheets() || m_ignoreP
endingStylesheets; } | 107 bool haveStylesheetsLoaded() const { return !hasPendingSheets() || m_ignoreP
endingStylesheets; } |
| 108 bool haveRenderBlockingStylesheetsLoaded() const { return !hasPendingRenderB
lockingSheets() || m_ignorePendingStylesheets; } |
| 106 bool ignoringPendingStylesheets() const { return m_ignorePendingStylesheets;
} | 109 bool ignoringPendingStylesheets() const { return m_ignorePendingStylesheets;
} |
| 107 | 110 |
| 108 unsigned maxDirectAdjacentSelectors() const { return m_maxDirectAdjacentSele
ctors; } | 111 unsigned maxDirectAdjacentSelectors() const { return m_maxDirectAdjacentSele
ctors; } |
| 109 bool usesSiblingRules() const { return m_usesSiblingRules; } | 112 bool usesSiblingRules() const { return m_usesSiblingRules; } |
| 110 bool usesFirstLineRules() const { return m_usesFirstLineRules; } | 113 bool usesFirstLineRules() const { return m_usesFirstLineRules; } |
| 111 bool usesWindowInactiveSelector() const { return m_usesWindowInactiveSelecto
r; } | 114 bool usesWindowInactiveSelector() const { return m_usesWindowInactiveSelecto
r; } |
| 112 | 115 |
| 113 bool usesRemUnits() const { return m_usesRemUnits; } | 116 bool usesRemUnits() const { return m_usesRemUnits; } |
| 114 void setUsesRemUnit(bool b) { m_usesRemUnits = b; } | 117 void setUsesRemUnit(bool b) { m_usesRemUnits = b; } |
| 115 | 118 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 145 | 148 |
| 146 void removeFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&)
; | 149 void removeFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&)
; |
| 147 void clearFontCache(); | 150 void clearFontCache(); |
| 148 // updateGenericFontFamilySettings is used from WebSettingsImpl. | 151 // updateGenericFontFamilySettings is used from WebSettingsImpl. |
| 149 void updateGenericFontFamilySettings(); | 152 void updateGenericFontFamilySettings(); |
| 150 | 153 |
| 151 void didDetach(); | 154 void didDetach(); |
| 152 bool shouldClearResolver() const; | 155 bool shouldClearResolver() const; |
| 153 void resolverChanged(StyleResolverUpdateMode); | 156 void resolverChanged(StyleResolverUpdateMode); |
| 154 | 157 |
| 155 CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startP
osition); | 158 CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startP
osition, StyleEngineContext&); |
| 156 void removeSheet(StyleSheetContents*); | 159 void removeSheet(StyleSheetContents*); |
| 157 | 160 |
| 158 void collectScopedStyleFeaturesTo(RuleFeatureSet&) const; | 161 void collectScopedStyleFeaturesTo(RuleFeatureSet&) const; |
| 159 void ensureFullscreenUAStyle(); | 162 void ensureFullscreenUAStyle(); |
| 160 | 163 |
| 161 void platformColorsChanged(); | 164 void platformColorsChanged(); |
| 162 | 165 |
| 163 void classChangedForElement(const SpaceSplitString& changedClasses, Element&
); | 166 void classChangedForElement(const SpaceSplitString& changedClasses, Element&
); |
| 164 void classChangedForElement(const SpaceSplitString& oldClasses, const SpaceS
plitString& newClasses, Element&); | 167 void classChangedForElement(const SpaceSplitString& oldClasses, const SpaceS
plitString& newClasses, Element&); |
| 165 void attributeChangedForElement(const QualifiedName& attributeName, Element&
); | 168 void attributeChangedForElement(const QualifiedName& attributeName, Element&
); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool shouldSkipInvalidationFor(const Element&) const; | 219 bool shouldSkipInvalidationFor(const Element&) const; |
| 217 | 220 |
| 218 Member<Document> m_document; | 221 Member<Document> m_document; |
| 219 bool m_isMaster; | 222 bool m_isMaster; |
| 220 | 223 |
| 221 // Track the number of currently loading top-level stylesheets needed for la
yout. | 224 // Track the number of currently loading top-level stylesheets needed for la
yout. |
| 222 // Sheets loaded using the @import directive are not included in this count. | 225 // Sheets loaded using the @import directive are not included in this count. |
| 223 // We use this count of pending sheets to detect when we can begin attaching | 226 // We use this count of pending sheets to detect when we can begin attaching |
| 224 // elements and when it is safe to execute scripts. | 227 // elements and when it is safe to execute scripts. |
| 225 int m_pendingStylesheets = 0; | 228 int m_pendingStylesheets = 0; |
| 229 int m_pendingRenderBlockingStylesheets = 0; |
| 226 | 230 |
| 227 HeapVector<Member<CSSStyleSheet>> m_injectedAuthorStyleSheets; | 231 HeapVector<Member<CSSStyleSheet>> m_injectedAuthorStyleSheets; |
| 228 | 232 |
| 229 Member<DocumentStyleSheetCollection> m_documentStyleSheetCollection; | 233 Member<DocumentStyleSheetCollection> m_documentStyleSheetCollection; |
| 230 | 234 |
| 231 typedef HeapHashMap<WeakMember<TreeScope>, Member<ShadowTreeStyleSheetCollec
tion>> StyleSheetCollectionMap; | 235 typedef HeapHashMap<WeakMember<TreeScope>, Member<ShadowTreeStyleSheetCollec
tion>> StyleSheetCollectionMap; |
| 232 StyleSheetCollectionMap m_styleSheetCollectionMap; | 236 StyleSheetCollectionMap m_styleSheetCollectionMap; |
| 233 | 237 |
| 234 bool m_documentScopeDirty = true; | 238 bool m_documentScopeDirty = true; |
| 235 UnorderedTreeScopeSet m_dirtyTreeScopes; | 239 UnorderedTreeScopeSet m_dirtyTreeScopes; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 257 | 261 |
| 258 OwnPtr<StyleResolverStats> m_styleResolverStats; | 262 OwnPtr<StyleResolverStats> m_styleResolverStats; |
| 259 unsigned m_styleForElementCount = 0; | 263 unsigned m_styleForElementCount = 0; |
| 260 | 264 |
| 261 friend class StyleEngineTest; | 265 friend class StyleEngineTest; |
| 262 }; | 266 }; |
| 263 | 267 |
| 264 } // namespace blink | 268 } // namespace blink |
| 265 | 269 |
| 266 #endif | 270 #endif |
| OLD | NEW |