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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 explicit StyleResolver(Document&); | 98 explicit StyleResolver(Document&); |
99 virtual ~StyleResolver(); | 99 virtual ~StyleResolver(); |
100 | 100 |
101 // FIXME: StyleResolver should not be keeping tree-walk state. | 101 // FIXME: StyleResolver should not be keeping tree-walk state. |
102 // These should move to some global tree-walk state, or should be contained
in a | 102 // These should move to some global tree-walk state, or should be contained
in a |
103 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. | 103 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. |
104 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. | 104 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. |
105 void pushParentElement(Element&); | 105 void pushParentElement(Element&); |
106 void popParentElement(Element&); | 106 void popParentElement(Element&); |
107 | 107 |
108 PassRefPtr<LayoutStyle> styleForElement(Element*, const LayoutStyle* parentS
tyle = 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&, const
LayoutStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animati
onName); | 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&, const 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(); | 118 PassRefPtr<LayoutStyle> defaultStyleForElement(); |
119 PassRefPtr<LayoutStyle> styleForText(Text*); | 119 PassRefPtr<LayoutStyle> styleForText(Text*); |
120 | 120 |
121 static PassRefPtr<LayoutStyle> styleForDocument(Document&); | 121 static PassRefPtr<LayoutStyle> styleForDocument(Document&); |
122 | 122 |
123 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte
r we factor StyleResolver further. | 123 // 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 | 124 // https://bugs.webkit.org/show_bug.cgi?id=108890 |
125 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt
yleSheet> >&); | 125 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt
yleSheet> >&); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); | 244 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); |
245 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); | 245 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); |
246 void collectViewportRules(); | 246 void collectViewportRules(); |
247 | 247 |
248 bool isLeftPage(int pageIndex) const; | 248 bool isLeftPage(int pageIndex) const; |
249 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } | 249 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } |
250 bool isFirstPage(int pageIndex) const; | 250 bool isFirstPage(int pageIndex) const; |
251 String pageName(int pageIndex) const; | 251 String pageName(int pageIndex) const; |
252 | 252 |
253 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, cons
t LayoutStyle* parentStyle, StyleResolverState&); | 253 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Layo
utStyle* parentStyle, StyleResolverState&); |
254 | 254 |
255 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); | 255 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); |
256 | 256 |
257 Document& document() { return *m_document; } | 257 Document& document() { return *m_document; } |
258 | 258 |
259 static LayoutStyle* s_styleNotYetAvailable; | 259 static LayoutStyle* s_styleNotYetAvailable; |
260 | 260 |
261 void cacheBorderAndBackground(); | 261 void cacheBorderAndBackground(); |
262 | 262 |
263 MatchedPropertiesCache m_matchedPropertiesCache; | 263 MatchedPropertiesCache m_matchedPropertiesCache; |
(...skipping 28 matching lines...) Expand all Loading... |
292 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 292 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
293 unsigned m_styleResolverStatsSequence; | 293 unsigned m_styleResolverStatsSequence; |
294 | 294 |
295 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 295 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
296 unsigned m_accessCount; | 296 unsigned m_accessCount; |
297 }; | 297 }; |
298 | 298 |
299 } // namespace blink | 299 } // namespace blink |
300 | 300 |
301 #endif // StyleResolver_h | 301 #endif // StyleResolver_h |
OLD | NEW |