| 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*, LayoutStyle* parentStyle =
0, StyleSharingBehavior = AllowStyleSharing, | 108 PassRefPtr<LayoutStyle> styleForElement(Element*, const LayoutStyle* parentS
tyle = 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&, const
LayoutStyle* parentStyle, const StyleRuleKeyframe*, const AtomicString& animati
onName); |
| 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&, const 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); | 241 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); |
| 242 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); | 242 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage
> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&,
bool isLeftPage, bool isFirstPage, const String& pageName); |
| 243 void collectViewportRules(); | 243 void collectViewportRules(); |
| 244 | 244 |
| 245 bool isLeftPage(int pageIndex) const; | 245 bool isLeftPage(int pageIndex) const; |
| 246 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } | 246 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } |
| 247 bool isFirstPage(int pageIndex) const; | 247 bool isFirstPage(int pageIndex) const; |
| 248 String pageName(int pageIndex) const; | 248 String pageName(int pageIndex) const; |
| 249 | 249 |
| 250 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Layo
utStyle* parentStyle, StyleResolverState&); | 250 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, cons
t LayoutStyle* parentStyle, StyleResolverState&); |
| 251 | 251 |
| 252 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); | 252 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElement(Element* parent, P
seudoId); |
| 253 | 253 |
| 254 Document& document() { return *m_document; } | 254 Document& document() { return *m_document; } |
| 255 | 255 |
| 256 static LayoutStyle* s_styleNotYetAvailable; | 256 static LayoutStyle* s_styleNotYetAvailable; |
| 257 | 257 |
| 258 void cacheBorderAndBackground(); | 258 void cacheBorderAndBackground(); |
| 259 | 259 |
| 260 MatchedPropertiesCache m_matchedPropertiesCache; | 260 MatchedPropertiesCache m_matchedPropertiesCache; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 289 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 289 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
| 290 unsigned m_styleResolverStatsSequence; | 290 unsigned m_styleResolverStatsSequence; |
| 291 | 291 |
| 292 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 292 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
| 293 unsigned m_accessCount; | 293 unsigned m_accessCount; |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 } // namespace blink | 296 } // namespace blink |
| 297 | 297 |
| 298 #endif // StyleResolver_h | 298 #endif // StyleResolver_h |
| OLD | NEW |