OLD | NEW |
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 explicit StyleResolver(Document&); | 95 explicit StyleResolver(Document&); |
96 virtual ~StyleResolver(); | 96 virtual ~StyleResolver(); |
97 | 97 |
98 // FIXME: StyleResolver should not be keeping tree-walk state. | 98 // FIXME: StyleResolver should not be keeping tree-walk state. |
99 // These should move to some global tree-walk state, or should be contained
in a | 99 // These should move to some global tree-walk state, or should be contained
in a |
100 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. | 100 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. |
101 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. | 101 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. |
102 void pushParentElement(Element&); | 102 void pushParentElement(Element&); |
103 void popParentElement(Element&); | 103 void popParentElement(Element&); |
104 | 104 |
105 PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle =
0, StyleSharingBehavior = AllowStyleSharing, | 105 PassRefPtr<RenderStyle> styleForElement(Element*, const RenderStyle* parentS
tyle = 0, StyleSharingBehavior = AllowStyleSharing, |
106 RuleMatchingBehavior = MatchAllRules); | 106 RuleMatchingBehavior = MatchAllRules); |
107 | 107 |
108 PassRefPtr<RenderStyle> styleForKeyframe(Element&, const RenderStyle&, Rende
rStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animationName
); | 108 PassRefPtr<RenderStyle> styleForKeyframe(Element&, const RenderStyle&, const
RenderStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animati
onName); |
109 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot
(Element&, CSSPropertyID, CSSValue&); | 109 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot
(Element&, CSSPropertyID, CSSValue&); |
110 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot
(StyleResolverState&, CSSPropertyID, CSSValue&); | 110 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot
(StyleResolverState&, CSSPropertyID, CSSValue&); |
111 | 111 |
112 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, RenderStyle* parentStyle); | 112 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, const RenderStyle* parentStyle); |
113 | 113 |
114 PassRefPtr<RenderStyle> styleForPage(int pageIndex); | 114 PassRefPtr<RenderStyle> styleForPage(int pageIndex); |
115 PassRefPtr<RenderStyle> defaultStyleForElement(); | 115 PassRefPtr<RenderStyle> defaultStyleForElement(); |
116 PassRefPtr<RenderStyle> styleForText(Text*); | 116 PassRefPtr<RenderStyle> styleForText(Text*); |
117 | 117 |
118 static PassRefPtr<RenderStyle> styleForDocument(Document&); | 118 static PassRefPtr<RenderStyle> styleForDocument(Document&); |
119 | 119 |
120 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte
r we factor StyleResolver further. | 120 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte
r we factor StyleResolver further. |
121 // https://bugs.webkit.org/show_bug.cgi?id=108890 | 121 // https://bugs.webkit.org/show_bug.cgi?id=108890 |
122 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt
yleSheet> >&); | 122 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt
yleSheet> >&); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); | 248 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); |
249 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); | 249 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); |
250 void collectViewportRules(); | 250 void collectViewportRules(); |
251 | 251 |
252 bool isLeftPage(int pageIndex) const; | 252 bool isLeftPage(int pageIndex) const; |
253 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } | 253 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } |
254 bool isFirstPage(int pageIndex) const; | 254 bool isFirstPage(int pageIndex) const; |
255 String pageName(int pageIndex) const; | 255 String pageName(int pageIndex) const; |
256 | 256 |
257 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Rend
erStyle* parentStyle, StyleResolverState&); | 257 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, cons
t RenderStyle* parentStyle, StyleResolverState&); |
258 | 258 |
259 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); | 259 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); |
260 | 260 |
261 Document& document() { return *m_document; } | 261 Document& document() { return *m_document; } |
262 | 262 |
263 static RenderStyle* s_styleNotYetAvailable; | 263 static RenderStyle* s_styleNotYetAvailable; |
264 | 264 |
265 void cacheBorderAndBackground(); | 265 void cacheBorderAndBackground(); |
266 | 266 |
267 MatchedPropertiesCache m_matchedPropertiesCache; | 267 MatchedPropertiesCache m_matchedPropertiesCache; |
(...skipping 28 matching lines...) Expand all Loading... |
296 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 296 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
297 unsigned m_styleResolverStatsSequence; | 297 unsigned m_styleResolverStatsSequence; |
298 | 298 |
299 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 299 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
300 unsigned m_accessCount; | 300 unsigned m_accessCount; |
301 }; | 301 }; |
302 | 302 |
303 } // namespace blink | 303 } // namespace blink |
304 | 304 |
305 #endif // StyleResolver_h | 305 #endif // StyleResolver_h |
OLD | NEW |