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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed web/mac/WebSubstringUtil.mm Created 5 years, 10 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 | 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 * 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 explicit StyleResolver(Document&); 96 explicit StyleResolver(Document&);
97 virtual ~StyleResolver(); 97 virtual ~StyleResolver();
98 98
99 // FIXME: StyleResolver should not be keeping tree-walk state. 99 // FIXME: StyleResolver should not be keeping tree-walk state.
100 // These should move to some global tree-walk state, or should be contained in a 100 // These should move to some global tree-walk state, or should be contained in a
101 // TreeWalkContext or similar which is passed in to StyleResolver methods wh en available. 101 // TreeWalkContext or similar which is passed in to StyleResolver methods wh en available.
102 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups. 102 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups.
103 void pushParentElement(Element&); 103 void pushParentElement(Element&);
104 void popParentElement(Element&); 104 void popParentElement(Element&);
105 105
106 PassRefPtr<LayoutStyle> styleForElement(Element*, LayoutStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing, 106 PassRefPtr<LayoutStyle> styleForElement(Element*, const LayoutStyle* parentS tyle = 0, StyleSharingBehavior = AllowStyleSharing,
107 RuleMatchingBehavior = MatchAllRules); 107 RuleMatchingBehavior = MatchAllRules);
108 108
109 PassRefPtr<LayoutStyle> styleForKeyframe(Element&, const LayoutStyle&, Layou tStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animationName ); 109 PassRefPtr<LayoutStyle> styleForKeyframe(Element&, const LayoutStyle&, const LayoutStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animati onName);
110 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (Element&, CSSPropertyID, CSSValue&); 110 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (Element&, CSSPropertyID, CSSValue&);
111 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue&); 111 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue&);
112 112
113 PassRefPtr<LayoutStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, LayoutStyle* parentStyle); 113 PassRefPtr<LayoutStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, const LayoutStyle* parentStyle);
114 114
115 PassRefPtr<LayoutStyle> styleForPage(int pageIndex); 115 PassRefPtr<LayoutStyle> styleForPage(int pageIndex);
116 PassRefPtr<LayoutStyle> defaultStyleForElement(); 116 PassRefPtr<LayoutStyle> defaultStyleForElement();
117 PassRefPtr<LayoutStyle> styleForText(Text*); 117 PassRefPtr<LayoutStyle> styleForText(Text*);
118 118
119 static PassRefPtr<LayoutStyle> styleForDocument(Document&); 119 static PassRefPtr<LayoutStyle> styleForDocument(Document&);
120 120
121 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 121 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
122 // https://bugs.webkit.org/show_bug.cgi?id=108890 122 // https://bugs.webkit.org/show_bug.cgi?id=108890
123 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet> >&); 123 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet> >&);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName); 239 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName);
240 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName); 240 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName);
241 void collectViewportRules(); 241 void collectViewportRules();
242 242
243 bool isLeftPage(int pageIndex) const; 243 bool isLeftPage(int pageIndex) const;
244 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } 244 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
245 bool isFirstPage(int pageIndex) const; 245 bool isFirstPage(int pageIndex) const;
246 String pageName(int pageIndex) const; 246 String pageName(int pageIndex) const;
247 247
248 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Layo utStyle* parentStyle, StyleResolverState&); 248 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, cons t LayoutStyle* parentStyle, StyleResolverState&);
249 249
250 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P seudoId); 250 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P seudoId);
251 251
252 Document& document() { return *m_document; } 252 Document& document() { return *m_document; }
253 253
254 static LayoutStyle* s_styleNotYetAvailable; 254 static LayoutStyle* s_styleNotYetAvailable;
255 255
256 void cacheBorderAndBackground(); 256 void cacheBorderAndBackground();
257 257
258 MatchedPropertiesCache m_matchedPropertiesCache; 258 MatchedPropertiesCache m_matchedPropertiesCache;
(...skipping 28 matching lines...) Expand all
287 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 287 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
288 unsigned m_styleResolverStatsSequence; 288 unsigned m_styleResolverStatsSequence;
289 289
290 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 290 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
291 unsigned m_accessCount; 291 unsigned m_accessCount;
292 }; 292 };
293 293
294 } // namespace blink 294 } // namespace blink
295 295
296 #endif // StyleResolver_h 296 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698