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

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

Issue 66383005: Remove the concept of user stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix WebFrameCSSCallbackTest tests Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class StyleEngine { 51 class StyleEngine {
52 WTF_MAKE_FAST_ALLOCATED; 52 WTF_MAKE_FAST_ALLOCATED;
53 public: 53 public:
54 static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr( new StyleEngine(document)); } 54 static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr( new StyleEngine(document)); }
55 55
56 ~StyleEngine(); 56 ~StyleEngine();
57 57
58 const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&); 58 const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&);
59 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const; 59 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const;
60 60
61 CSSStyleSheet* pageUserSheet();
62 const Vector<RefPtr<CSSStyleSheet> >& documentUserStyleSheets() const { retu rn m_userStyleSheets; }
63 const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { re turn m_authorStyleSheets; } 61 const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { re turn m_authorStyleSheets; }
64 const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const; 62 const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const;
65 63
66 void modifiedStyleSheet(StyleSheet*); 64 void modifiedStyleSheet(StyleSheet*);
67 void addStyleSheetCandidateNode(Node*, bool createdByParser); 65 void addStyleSheetCandidateNode(Node*, bool createdByParser);
68 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode = 0); 66 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode = 0);
69 void modifiedStyleSheetCandidateNode(Node*); 67 void modifiedStyleSheetCandidateNode(Node*);
70 68
71 void clearPageUserSheet();
72 void updatePageUserSheet();
73 void invalidateInjectedStyleSheetCache(); 69 void invalidateInjectedStyleSheetCache();
74 void updateInjectedStyleSheetCache() const; 70 void updateInjectedStyleSheetCache() const;
75 71
76 void addAuthorSheet(PassRefPtr<StyleSheetContents> authorSheet); 72 void addAuthorSheet(PassRefPtr<StyleSheetContents> authorSheet);
77 void addUserSheet(PassRefPtr<StyleSheetContents> userSheet);
78 73
79 bool needsUpdateActiveStylesheetsOnStyleRecalc() const { return m_needsUpdat eActiveStylesheetsOnStyleRecalc; } 74 bool needsUpdateActiveStylesheetsOnStyleRecalc() const { return m_needsUpdat eActiveStylesheetsOnStyleRecalc; }
80 75
81 bool updateActiveStyleSheets(StyleResolverUpdateMode); 76 bool updateActiveStyleSheets(StyleResolverUpdateMode);
82 77
83 String preferredStylesheetSetName() const { return m_preferredStylesheetSetN ame; } 78 String preferredStylesheetSetName() const { return m_preferredStylesheetSetN ame; }
84 String selectedStylesheetSetName() const { return m_selectedStylesheetSetNam e; } 79 String selectedStylesheetSetName() const { return m_selectedStylesheetSetNam e; }
85 void setPreferredStylesheetSetName(const String& name) { m_preferredStyleshe etSetName = name; } 80 void setPreferredStylesheetSetName(const String& name) { m_preferredStyleshe etSetName = name; }
86 void setSelectedStylesheetSetName(const String& name) { m_selectedStylesheet SetName = name; } 81 void setSelectedStylesheetSetName(const String& name) { m_selectedStylesheet SetName = name; }
87 82
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*); 119 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*);
125 120
126 Document& m_document; 121 Document& m_document;
127 122
128 // Track the number of currently loading top-level stylesheets needed for re ndering. 123 // Track the number of currently loading top-level stylesheets needed for re ndering.
129 // Sheets loaded using the @import directive are not included in this count. 124 // Sheets loaded using the @import directive are not included in this count.
130 // We use this count of pending sheets to detect when we can begin attaching 125 // We use this count of pending sheets to detect when we can begin attaching
131 // elements and when it is safe to execute scripts. 126 // elements and when it is safe to execute scripts.
132 int m_pendingStylesheets; 127 int m_pendingStylesheets;
133 128
134 RefPtr<CSSStyleSheet> m_pageUserSheet;
135
136 mutable Vector<RefPtr<CSSStyleSheet> > m_injectedAuthorStyleSheets; 129 mutable Vector<RefPtr<CSSStyleSheet> > m_injectedAuthorStyleSheets;
137 mutable bool m_injectedStyleSheetCacheValid; 130 mutable bool m_injectedStyleSheetCacheValid;
138 131
139 Vector<RefPtr<CSSStyleSheet> > m_userStyleSheets;
140 Vector<RefPtr<CSSStyleSheet> > m_authorStyleSheets; 132 Vector<RefPtr<CSSStyleSheet> > m_authorStyleSheets;
141 133
142 bool m_needsUpdateActiveStylesheetsOnStyleRecalc; 134 bool m_needsUpdateActiveStylesheetsOnStyleRecalc;
143 135
144 DocumentStyleSheetCollection m_documentStyleSheetCollection; 136 DocumentStyleSheetCollection m_documentStyleSheetCollection;
145 HashMap<TreeScope*, OwnPtr<StyleSheetCollection> > m_styleSheetCollectionMap ; 137 HashMap<TreeScope*, OwnPtr<StyleSheetCollection> > m_styleSheetCollectionMap ;
146 138
147 TreeScopeSet m_dirtyTreeScopes; 139 TreeScopeSet m_dirtyTreeScopes;
148 TreeScopeSet m_activeTreeScopes; 140 TreeScopeSet m_activeTreeScopes;
149 bool m_needsDocumentStyleSheetsUpdate; 141 bool m_needsDocumentStyleSheetsUpdate;
150 142
151 String m_preferredStylesheetSetName; 143 String m_preferredStylesheetSetName;
152 String m_selectedStylesheetSetName; 144 String m_selectedStylesheetSetName;
153 145
154 bool m_usesSiblingRules; 146 bool m_usesSiblingRules;
155 bool m_usesSiblingRulesOverride; 147 bool m_usesSiblingRulesOverride;
156 bool m_usesFirstLineRules; 148 bool m_usesFirstLineRules;
157 bool m_usesFirstLetterRules; 149 bool m_usesFirstLetterRules;
158 bool m_usesRemUnits; 150 bool m_usesRemUnits;
159 unsigned m_maxDirectAdjacentSelectors; 151 unsigned m_maxDirectAdjacentSelectors;
160 }; 152 };
161 153
162 } 154 }
163 155
164 #endif 156 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698