Changeset 117034 in webkit
- Timestamp:
- May 14, 2012, 11:36:25 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
css/StyleResolver.cpp (modified) (12 diffs)
-
css/StyleResolver.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117033 r117034 1 2012-05-14 Luke Macpherson <macpherson@chromium.org> 2 3 Make StyleResolver::applyMatchedProperties and ::applyProperties use enum template parameter instead of bool. 4 https://bugs.webkit.org/show_bug.cgi?id=86424 5 6 Reviewed by Dimitri Glazkov. 7 8 This patch changes from using a boolean template parameter for StyleResolver::applyMatchedProperties and 9 StyleResolver::applyProperties functions. The motivation for this change is that it paves the way for 10 CSS Variables to make the value tri-state, which is a requirement because variable definitions must occur 11 before high priority CSS properties such that they can be referenced by the latter. This change affects 12 only the type signatures of those functions, and not their behavior. 13 14 * css/StyleResolver.cpp: 15 (WebCore::StyleResolver::collectMatchingRulesForList): 16 * css/StyleResolver.h: 17 1 18 2012-05-14 MORITA Hajime <morrita@google.com> 2 19 -
trunk/Source/WebCore/css/StyleResolver.cpp
r116751 r117034 1693 1693 bool inheritedOnly = false; 1694 1694 if (keyframe->properties()) 1695 applyMatchedProperties< true>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);1695 applyMatchedProperties<HighPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly); 1696 1696 1697 1697 // If our font got dirtied, go ahead and update it now. … … 1704 1704 // Now do rest of the properties. 1705 1705 if (keyframe->properties()) 1706 applyMatchedProperties< false>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);1706 applyMatchedProperties<LowPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly); 1707 1707 1708 1708 // If our font got dirtied by one of the non-essential font props, … … 1861 1861 m_lineHeightValue = 0; 1862 1862 bool inheritedOnly = false; 1863 applyMatchedProperties< true>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);1863 applyMatchedProperties<HighPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly); 1864 1864 1865 1865 // If our font got dirtied, go ahead and update it now. … … 1870 1870 applyProperty(CSSPropertyLineHeight, m_lineHeightValue); 1871 1871 1872 applyMatchedProperties< false>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);1872 applyMatchedProperties<LowPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly); 1873 1873 1874 1874 // Start loading images referenced by this style. … … 2627 2627 } 2628 2628 2629 template < bool applyFirst>2629 template <StyleResolver::StyleApplicationPass pass> 2630 2630 void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRule* rule, bool isImportant, bool inheritedOnly, bool filterRegionProperties) 2631 2631 { … … 2650 2650 continue; 2651 2651 2652 if ( applyFirst) {2652 if (pass == HighPriorityProperties) { 2653 2653 COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property); 2654 2654 COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 18, CSS_zoom_is_end_of_first_prop_range); … … 2671 2671 } 2672 2672 2673 template < bool applyFirst>2673 template <StyleResolver::StyleApplicationPass pass> 2674 2674 void StyleResolver::applyMatchedProperties(const MatchResult& matchResult, bool isImportant, int startIndex, int endIndex, bool inheritedOnly) 2675 2675 { … … 2685 2685 m_applyPropertyToVisitedLinkStyle = linkMatchType & SelectorChecker::MatchVisited; 2686 2686 2687 applyProperties< applyFirst>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);2687 applyProperties<pass>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule); 2688 2688 } 2689 2689 m_applyPropertyToRegularStyle = true; … … 2693 2693 for (int i = startIndex; i <= endIndex; ++i) { 2694 2694 const MatchedProperties& matchedProperties = matchResult.matchedProperties[i]; 2695 applyProperties< applyFirst>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);2695 applyProperties<pass>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule); 2696 2696 } 2697 2697 } … … 2816 2816 // and (4) normal important. 2817 2817 m_lineHeightValue = 0; 2818 applyMatchedProperties< true>(matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly);2819 applyMatchedProperties< true>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);2820 applyMatchedProperties< true>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);2821 applyMatchedProperties< true>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);2818 applyMatchedProperties<HighPriorityProperties>(matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly); 2819 applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly); 2820 applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); 2821 applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 2822 2822 2823 2823 if (cacheItem && cacheItem->renderStyle->effectiveZoom() != m_style->effectiveZoom()) { … … 2838 2838 2839 2839 // Now do the normal priority UA properties. 2840 applyMatchedProperties< false>(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);2840 applyMatchedProperties<LowPriorityProperties>(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 2841 2841 2842 2842 // Cache our border and background so that we can examine them later. … … 2844 2844 2845 2845 // Now do the author and user normal priority properties and all the !important properties. 2846 applyMatchedProperties< false>(matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyInheritedOnly);2847 applyMatchedProperties< false>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);2848 applyMatchedProperties< false>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);2849 applyMatchedProperties< false>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);2846 applyMatchedProperties<LowPriorityProperties>(matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyInheritedOnly); 2847 applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly); 2848 applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); 2849 applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 2850 2850 2851 2851 loadPendingImages(); -
trunk/Source/WebCore/css/StyleResolver.h
r116471 r117034 354 354 bool checkRegionSelector(CSSSelector* regionSelector, Element* regionElement); 355 355 void applyMatchedProperties(const MatchResult&); 356 template <bool firstPass> 356 enum StyleApplicationPass { 357 HighPriorityProperties, 358 LowPriorityProperties 359 }; 360 template <StyleApplicationPass pass> 357 361 void applyMatchedProperties(const MatchResult&, bool important, int startIndex, int endIndex, bool inheritedOnly); 358 template < bool firstPass>362 template <StyleApplicationPass pass> 359 363 void applyProperties(const StylePropertySet* properties, StyleRule*, bool isImportant, bool inheritedOnly, bool filterRegionProperties); 360 364
Note:
See TracChangeset
for help on using the changeset viewer.