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 10 matching lines...) Expand all Loading... | |
| 21 * You should have received a copy of the GNU Library General Public License | 21 * You should have received a copy of the GNU Library General Public License |
| 22 * along with this library; see the file COPYING.LIB. If not, write to | 22 * along with this library; see the file COPYING.LIB. If not, write to |
| 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef StyleEngine_h | 28 #ifndef StyleEngine_h |
| 29 #define StyleEngine_h | 29 #define StyleEngine_h |
| 30 | 30 |
| 31 #include "core/css/StyleSheetContentsCache.h" | |
| 31 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 32 #include "core/dom/DocumentOrderedList.h" | 33 #include "core/dom/DocumentOrderedList.h" |
| 33 #include "core/dom/DocumentStyleSheetCollection.h" | 34 #include "core/dom/DocumentStyleSheetCollection.h" |
| 34 #include "wtf/FastAllocBase.h" | 35 #include "wtf/FastAllocBase.h" |
| 35 #include "wtf/ListHashSet.h" | 36 #include "wtf/ListHashSet.h" |
| 36 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 37 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 39 #include "wtf/text/AtomicString.h" | |
| 38 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 39 | 41 |
| 40 namespace WebCore { | 42 namespace WebCore { |
| 41 | 43 |
| 42 class CSSStyleSheet; | 44 class CSSStyleSheet; |
| 43 class Node; | 45 class Node; |
| 44 class RuleFeatureSet; | 46 class RuleFeatureSet; |
| 45 class ShadowTreeStyleSheetCollection; | 47 class ShadowTreeStyleSheetCollection; |
| 46 class StyleSheet; | 48 class StyleSheet; |
| 47 class StyleSheetCollection; | 49 class StyleSheetCollection; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 bool hasScopedStyleSheet() { return m_documentStyleSheetCollection.scopingNo desForStyleScoped(); } | 106 bool hasScopedStyleSheet() { return m_documentStyleSheetCollection.scopingNo desForStyleScoped(); } |
| 105 | 107 |
| 106 void combineCSSFeatureFlags(const RuleFeatureSet&); | 108 void combineCSSFeatureFlags(const RuleFeatureSet&); |
| 107 void resetCSSFeatureFlags(const RuleFeatureSet&); | 109 void resetCSSFeatureFlags(const RuleFeatureSet&); |
| 108 | 110 |
| 109 void didModifySeamlessParentStyleSheet() { m_needsDocumentStyleSheetsUpdate = true; } | 111 void didModifySeamlessParentStyleSheet() { m_needsDocumentStyleSheetsUpdate = true; } |
| 110 void didRemoveShadowRoot(ShadowRoot*); | 112 void didRemoveShadowRoot(ShadowRoot*); |
| 111 void appendActiveAuthorStyleSheets(StyleResolver*); | 113 void appendActiveAuthorStyleSheets(StyleResolver*); |
| 112 void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >* >& activeAuthorStyleSheets) const; | 114 void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >* >& activeAuthorStyleSheets) const; |
| 113 | 115 |
| 116 StyleSheetContents* findStyleSheetContents(const AtomicString&); | |
|
dglazkov
2013/10/21 18:24:10
Now that you have nice Cache member, why not just
tasak
2013/10/25 05:23:13
Done.
| |
| 117 void registerStyleSheetContents(const AtomicString&, StyleSheetContents*); | |
| 118 void unregisterStyleSheetContents(const AtomicString&); | |
| 119 | |
| 114 private: | 120 private: |
| 115 StyleEngine(Document&); | 121 StyleEngine(Document&); |
| 116 | 122 |
| 117 StyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); | 123 StyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); |
| 118 StyleSheetCollection* styleSheetCollectionFor(TreeScope&); | 124 StyleSheetCollection* styleSheetCollectionFor(TreeScope&); |
| 119 void activeStyleSheetsUpdatedForInspector(); | 125 void activeStyleSheetsUpdatedForInspector(); |
| 120 bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode); | 126 bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode); |
| 121 | 127 |
| 122 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; | 128 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; |
| 123 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*); | 129 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 148 bool m_needsDocumentStyleSheetsUpdate; | 154 bool m_needsDocumentStyleSheetsUpdate; |
| 149 | 155 |
| 150 String m_preferredStylesheetSetName; | 156 String m_preferredStylesheetSetName; |
| 151 String m_selectedStylesheetSetName; | 157 String m_selectedStylesheetSetName; |
| 152 | 158 |
| 153 bool m_usesSiblingRules; | 159 bool m_usesSiblingRules; |
| 154 bool m_usesSiblingRulesOverride; | 160 bool m_usesSiblingRulesOverride; |
| 155 bool m_usesFirstLineRules; | 161 bool m_usesFirstLineRules; |
| 156 bool m_usesFirstLetterRules; | 162 bool m_usesFirstLetterRules; |
| 157 bool m_usesRemUnits; | 163 bool m_usesRemUnits; |
| 164 | |
| 165 StyleSheetContentsCache m_styleSheetContentsCache; | |
| 158 }; | 166 }; |
| 159 | 167 |
| 160 } | 168 } |
| 161 | 169 |
| 162 #endif | 170 #endif |
| OLD | NEW |