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

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

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised 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
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 10 matching lines...) Expand all
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/resolver/StyleResolver.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/TemporaryChange.h" 38 #include "wtf/TemporaryChange.h"
38 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
39 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
40 41
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void appendActiveAuthorStyleSheets(StyleResolver*); 134 void appendActiveAuthorStyleSheets(StyleResolver*);
134 void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >* >& activeAuthorStyleSheets) const; 135 void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >* >& activeAuthorStyleSheets) const;
135 136
136 StyleResolver* resolverIfExists() const 137 StyleResolver* resolverIfExists() const
137 { 138 {
138 return m_resolver.get(); 139 return m_resolver.get();
139 } 140 }
140 141
141 StyleResolver* resolver() 142 StyleResolver* resolver()
142 { 143 {
143 if (!m_resolver) 144 if (!m_resolver) {
144 createResolver(); 145 createResolver();
146 } else if (m_resolver->hasPendingAuthorStyleSheets()) {
147 m_resolver->appendPendingAuthorStyleSheets();
148 }
145 return m_resolver.get(); 149 return m_resolver.get();
146 } 150 }
147 151
148 bool hasResolver() const { return m_resolver.get(); } 152 bool hasResolver() const { return m_resolver.get(); }
149 void clearResolver(); 153 void clearResolver();
150 154
151 CSSFontSelector* fontSelector(); 155 CSSFontSelector* fontSelector();
152 void didAttach(); 156 void didAttach();
153 void didDetach(); 157 void didDetach();
154 bool shouldClearResolver() const; 158 bool shouldClearResolver() const;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 bool m_ignorePendingStylesheets; 208 bool m_ignorePendingStylesheets;
205 bool m_didCalculateResolver; 209 bool m_didCalculateResolver;
206 unsigned m_lastResolverAccessCount; 210 unsigned m_lastResolverAccessCount;
207 Timer<StyleEngine> m_resolverThrowawayTimer; 211 Timer<StyleEngine> m_resolverThrowawayTimer;
208 OwnPtr<StyleResolver> m_resolver; 212 OwnPtr<StyleResolver> m_resolver;
209 }; 213 };
210 214
211 } 215 }
212 216
213 #endif 217 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698