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

Side by Side Diff: Source/core/css/resolver/StyleResolver.h

Issue 1001833002: Rename default -> initial style and use singletons. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/core/css/CSSMatrix.cpp ('k') | Source/core/css/resolver/StyleResolver.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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 PassRefPtr<LayoutStyle> styleForElement(Element*, LayoutStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing, 108 PassRefPtr<LayoutStyle> styleForElement(Element*, LayoutStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing,
109 RuleMatchingBehavior = MatchAllRules); 109 RuleMatchingBehavior = MatchAllRules);
110 110
111 PassRefPtr<LayoutStyle> styleForKeyframe(Element&, const LayoutStyle&, Layou tStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animationName ); 111 PassRefPtr<LayoutStyle> styleForKeyframe(Element&, const LayoutStyle&, Layou tStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animationName );
112 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (Element&, CSSPropertyID, CSSValue*); 112 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (Element&, CSSPropertyID, CSSValue*);
113 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue*); 113 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue*);
114 114
115 PassRefPtr<LayoutStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, LayoutStyle* parentStyle); 115 PassRefPtr<LayoutStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, LayoutStyle* parentStyle);
116 116
117 PassRefPtr<LayoutStyle> styleForPage(int pageIndex); 117 PassRefPtr<LayoutStyle> styleForPage(int pageIndex);
118 PassRefPtr<LayoutStyle> defaultStyleForElement();
119 PassRefPtr<LayoutStyle> styleForText(Text*); 118 PassRefPtr<LayoutStyle> styleForText(Text*);
120 119
121 static PassRefPtr<LayoutStyle> styleForDocument(Document&); 120 static PassRefPtr<LayoutStyle> styleForDocument(Document&);
122 121
123 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 122 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
124 // https://bugs.webkit.org/show_bug.cgi?id=108890 123 // https://bugs.webkit.org/show_bug.cgi?id=108890
125 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet>>&); 124 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet>>&);
126 void resetAuthorStyle(TreeScope&); 125 void resetAuthorStyle(TreeScope&);
127 void finishAppendAuthorStyleSheets(); 126 void finishAppendAuthorStyleSheets();
128 127
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } 197 void increaseStyleSharingDepth() { ++m_styleSharingDepth; }
199 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } 198 void decreaseStyleSharingDepth() { --m_styleSharingDepth; }
200 199
201 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElementIfNeeded(Element& p arent, PseudoId); 200 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElementIfNeeded(Element& p arent, PseudoId);
202 201
203 DECLARE_TRACE(); 202 DECLARE_TRACE();
204 203
205 void addTreeBoundaryCrossingScope(ContainerNode& scope); 204 void addTreeBoundaryCrossingScope(ContainerNode& scope);
206 205
207 private: 206 private:
207 PassRefPtr<LayoutStyle> initialStyleForElement();
208
208 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl eRule>>& watchedSelectors); 209 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl eRule>>& watchedSelectors);
209 210
210 // FIXME: This should probably go away, folded into FontBuilder. 211 // FIXME: This should probably go away, folded into FontBuilder.
211 void updateFont(StyleResolverState&); 212 void updateFont(StyleResolverState&);
212 213
213 static AuthorStyleInfo authorStyleInfo(StyleResolverState&); 214 static AuthorStyleInfo authorStyleInfo(StyleResolverState&);
214 215
215 void loadPendingResources(StyleResolverState&); 216 void loadPendingResources(StyleResolverState&);
216 void adjustLayoutStyle(StyleResolverState&, Element*); 217 void adjustLayoutStyle(StyleResolverState&, Element*);
217 218
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 293 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
293 unsigned m_styleResolverStatsSequence; 294 unsigned m_styleResolverStatsSequence;
294 295
295 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 296 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
296 unsigned m_accessCount; 297 unsigned m_accessCount;
297 }; 298 };
298 299
299 } // namespace blink 300 } // namespace blink
300 301
301 #endif // StyleResolver_h 302 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSMatrix.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698