Modified: trunk/Source/WebCore/css/StyleResolver.cpp (117033 => 117034)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2012-05-15 06:30:25 UTC (rev 117033)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2012-05-15 06:36:25 UTC (rev 117034)
@@ -1692,7 +1692,7 @@
// decl, there's nothing to override. So just add the first properties.
bool inheritedOnly = false;
if (keyframe->properties())
- applyMatchedProperties<true>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
// If our font got dirtied, go ahead and update it now.
updateFont();
@@ -1703,7 +1703,7 @@
// Now do rest of the properties.
if (keyframe->properties())
- applyMatchedProperties<false>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
// If our font got dirtied by one of the non-essential font props,
// go ahead and update it a second time.
@@ -1860,7 +1860,7 @@
matchPageRules(result, m_authorStyle.get(), isLeft, isFirst, page);
m_lineHeightValue = 0;
bool inheritedOnly = false;
- applyMatchedProperties<true>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
// If our font got dirtied, go ahead and update it now.
updateFont();
@@ -1869,7 +1869,7 @@
if (m_lineHeightValue)
applyProperty(CSSPropertyLineHeight, m_lineHeightValue);
- applyMatchedProperties<false>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(result, false, 0, result.matchedProperties.size() - 1, inheritedOnly);
// Start loading images referenced by this style.
loadPendingImages();
@@ -2626,7 +2626,7 @@
return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
}
-template <bool applyFirst>
+template <StyleResolver::StyleApplicationPass pass>
void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRule* rule, bool isImportant, bool inheritedOnly, bool filterRegionProperties)
{
ASSERT(!filterRegionProperties || m_regionForStyling);
@@ -2649,7 +2649,7 @@
if (filterRegionProperties && !StyleResolver::isValidRegionStyleProperty(property))
continue;
- if (applyFirst) {
+ if (pass == HighPriorityProperties) {
COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property);
COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 18, CSS_zoom_is_end_of_first_prop_range);
COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyZoom + 1, CSS_line_height_is_after_zoom);
@@ -2670,7 +2670,7 @@
InspectorInstrumentation::didProcessRule(cookie);
}
-template <bool applyFirst>
+template <StyleResolver::StyleApplicationPass pass>
void StyleResolver::applyMatchedProperties(const MatchResult& matchResult, bool isImportant, int startIndex, int endIndex, bool inheritedOnly)
{
if (startIndex == -1)
@@ -2684,7 +2684,7 @@
m_applyPropertyToRegularStyle = linkMatchType & SelectorChecker::MatchLink;
m_applyPropertyToVisitedLinkStyle = linkMatchType & SelectorChecker::MatchVisited;
- applyProperties<applyFirst>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);
+ applyProperties<pass>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);
}
m_applyPropertyToRegularStyle = true;
m_applyPropertyToVisitedLinkStyle = false;
@@ -2692,7 +2692,7 @@
}
for (int i = startIndex; i <= endIndex; ++i) {
const MatchedProperties& matchedProperties = matchResult.matchedProperties[i];
- applyProperties<applyFirst>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);
+ applyProperties<pass>(matchedProperties.properties.get(), matchResult.matchedRules[i], isImportant, inheritedOnly, matchedProperties.isInRegionRule);
}
}
@@ -2815,10 +2815,10 @@
// The order is (1) high-priority not important, (2) high-priority important, (3) normal not important
// and (4) normal important.
m_lineHeightValue = 0;
- applyMatchedProperties<true>(matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
- applyMatchedProperties<true>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
- applyMatchedProperties<true>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
- applyMatchedProperties<true>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
+ applyMatchedProperties<HighPriorityProperties>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
if (cacheItem && cacheItem->renderStyle->effectiveZoom() != m_style->effectiveZoom()) {
m_fontDirty = true;
@@ -2837,16 +2837,16 @@
applyInheritedOnly = false;
// Now do the normal priority UA properties.
- applyMatchedProperties<false>(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
// Cache our border and background so that we can examine them later.
cacheBorderAndBackground();
// Now do the author and user normal priority properties and all the !important properties.
- applyMatchedProperties<false>(matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
- applyMatchedProperties<false>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
- applyMatchedProperties<false>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
- applyMatchedProperties<false>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
+ applyMatchedProperties<LowPriorityProperties>(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
loadPendingImages();