| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 LowPriorityProperties | 304 LowPriorityProperties |
| 305 }; | 305 }; |
| 306 template <StyleResolver::StyleApplicationPass pass> | 306 template <StyleResolver::StyleApplicationPass pass> |
| 307 static inline bool isPropertyForPass(CSSPropertyID); | 307 static inline bool isPropertyForPass(CSSPropertyID); |
| 308 template <StyleApplicationPass pass> | 308 template <StyleApplicationPass pass> |
| 309 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im
portant, int startIndex, int endIndex, bool inheritedOnly); | 309 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im
portant, int startIndex, int endIndex, bool inheritedOnly); |
| 310 template <StyleApplicationPass pass> | 310 template <StyleApplicationPass pass> |
| 311 void applyProperties(StyleResolverState&, const StylePropertySet* properties
, StyleRule*, bool isImportant, bool inheritedOnly, PropertyWhitelistType = Prop
ertyWhitelistNone); | 311 void applyProperties(StyleResolverState&, const StylePropertySet* properties
, StyleRule*, bool isImportant, bool inheritedOnly, PropertyWhitelistType = Prop
ertyWhitelistNone); |
| 312 template <StyleApplicationPass pass> | 312 template <StyleApplicationPass pass> |
| 313 void applyAnimatedProperties(StyleResolverState&, const Element*, const Docu
mentTimeline*, const CSSAnimationUpdate*); | 313 void applyAnimatedProperties(StyleResolverState&, const Element*, const Docu
mentTimeline*, const CSSAnimationUpdate*); |
| 314 void resolveVariables(StyleResolverState&, CSSPropertyID, CSSValue*, Vector<
std::pair<CSSPropertyID, String> >& knownExpressions); | |
| 315 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); | 314 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag
e, const String& pageName); |
| 316 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto
r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName); | 315 void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vecto
r<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName); |
| 317 void collectViewportRules(); | 316 void collectViewportRules(); |
| 318 Settings* documentSettings() { return m_document->settings(); } | 317 Settings* documentSettings() { return m_document->settings(); } |
| 319 | 318 |
| 320 bool isLeftPage(int pageIndex) const; | 319 bool isLeftPage(int pageIndex) const; |
| 321 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } | 320 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } |
| 322 bool isFirstPage(int pageIndex) const; | 321 bool isFirstPage(int pageIndex) const; |
| 323 String pageName(int pageIndex) const; | 322 String pageName(int pageIndex) const; |
| 324 | 323 |
| 325 DocumentRuleSets m_ruleSets; | 324 DocumentRuleSets m_ruleSets; |
| 326 | 325 |
| 327 // FIXME: This likely belongs on RuleSet. | 326 // FIXME: This likely belongs on RuleSet. |
| 328 typedef HashMap<StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRuleMap; | 327 typedef HashMap<StringImpl*, RefPtr<StyleRuleKeyframes> > KeyframesRuleMap; |
| 329 KeyframesRuleMap m_keyframesRuleMap; | 328 KeyframesRuleMap m_keyframesRuleMap; |
| 330 | 329 |
| 331 static RenderStyle* s_styleNotYetAvailable; | 330 static RenderStyle* s_styleNotYetAvailable; |
| 332 | 331 |
| 333 void cacheBorderAndBackground(); | 332 void cacheBorderAndBackground(); |
| 334 | 333 |
| 335 void applyProperty(StyleResolverState&, CSSPropertyID, CSSValue*); | |
| 336 | |
| 337 MatchedPropertiesCache m_matchedPropertiesCache; | 334 MatchedPropertiesCache m_matchedPropertiesCache; |
| 338 | 335 |
| 339 OwnPtr<MediaQueryEvaluator> m_medium; | 336 OwnPtr<MediaQueryEvaluator> m_medium; |
| 340 RefPtr<RenderStyle> m_rootDefaultStyle; | 337 RefPtr<RenderStyle> m_rootDefaultStyle; |
| 341 | 338 |
| 342 Document* m_document; | 339 Document* m_document; |
| 343 SelectorFilter m_selectorFilter; | 340 SelectorFilter m_selectorFilter; |
| 344 | 341 |
| 345 bool m_matchAuthorAndUserStyles; | 342 bool m_matchAuthorAndUserStyles; |
| 346 | 343 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 357 OwnPtr<RuleSet> m_siblingRuleSet; | 354 OwnPtr<RuleSet> m_siblingRuleSet; |
| 358 OwnPtr<RuleSet> m_uncommonAttributeRuleSet; | 355 OwnPtr<RuleSet> m_uncommonAttributeRuleSet; |
| 359 | 356 |
| 360 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; | 357 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; |
| 361 | 358 |
| 362 StyleResourceLoader m_styleResourceLoader; | 359 StyleResourceLoader m_styleResourceLoader; |
| 363 | 360 |
| 364 #ifdef STYLE_STATS | 361 #ifdef STYLE_STATS |
| 365 static StyleSharingStats m_styleSharingStats; | 362 static StyleSharingStats m_styleSharingStats; |
| 366 #endif | 363 #endif |
| 367 | |
| 368 friend void StyleBuilder::oldApplyProperty(CSSPropertyID, StyleResolver*, St
yleResolverState&, CSSValue*, bool isInitial, bool isInherit); | |
| 369 | |
| 370 }; | 364 }; |
| 371 | 365 |
| 372 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi
onElement) | 366 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi
onElement) |
| 373 { | 367 { |
| 374 if (!regionSelector || !regionElement) | 368 if (!regionSelector || !regionElement) |
| 375 return false; | 369 return false; |
| 376 | 370 |
| 377 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker::
QueryingRules); | 371 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker::
QueryingRules); |
| 378 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s))
{ | 372 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s))
{ |
| 379 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi
onElement, SelectorChecker::VisitedMatchDisabled); | 373 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi
onElement, SelectorChecker::VisitedMatchDisabled); |
| 380 PseudoId ignoreDynamicPseudo = NOPSEUDO; | 374 PseudoId ignoreDynamicPseudo = NOPSEUDO; |
| 381 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo,
DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) | 375 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo,
DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) |
| 382 return true; | 376 return true; |
| 383 } | 377 } |
| 384 return false; | 378 return false; |
| 385 } | 379 } |
| 386 | 380 |
| 387 } // namespace WebCore | 381 } // namespace WebCore |
| 388 | 382 |
| 389 #endif // StyleResolver_h | 383 #endif // StyleResolver_h |
| OLD | NEW |