OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
524 // Inline style is immutable as long as there is no CSSOM wrapper. | 524 // Inline style is immutable as long as there is no CSSOM wrapper. |
525 // FIXME: Media control shadow trees seem to have problems with cach ing. | 525 // FIXME: Media control shadow trees seem to have problems with cach ing. |
526 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut able() && !state.element()->isInShadowTree(); | 526 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut able() && !state.element()->isInShadowTree(); |
527 // FIXME: Constify. | 527 // FIXME: Constify. |
528 collector.addElementStyleProperties(state.element()->inlineStyle(), isInlineStyleCacheable); | 528 collector.addElementStyleProperties(state.element()->inlineStyle(), isInlineStyleCacheable); |
529 } | 529 } |
530 | 530 |
531 // Now check SMIL animation override style. | 531 // Now check SMIL animation override style. |
532 if (includeSMILProperties && state.element()->isSVGElement()) | 532 if (includeSMILProperties && state.element()->isSVGElement()) |
533 collector.addElementStyleProperties(toSVGElement(state.element())->a nimatedSMILStyleProperties(), false /* isCacheable */); | 533 collector.addElementStyleProperties(toSVGElement(state.element())->a nimatedSMILStyleProperties(), false /* isCacheable */); |
534 | |
535 if (state.element()->hasActiveAnimations()) | |
536 collector.matchedResult().isCacheable = false; | |
537 } | 534 } |
538 } | 535 } |
539 | 536 |
540 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document, CSSF ontSelector* fontSelector) | 537 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document& document, CSSF ontSelector* fontSelector) |
541 { | 538 { |
542 const Frame* frame = document.frame(); | 539 const Frame* frame = document.frame(); |
543 | 540 |
544 // HTML5 states that seamless iframes should replace default CSS values | 541 // HTML5 states that seamless iframes should replace default CSS values |
545 // with values inherited from the containing iframe element. However, | 542 // with values inherited from the containing iframe element. However, |
546 // some values (such as the case of designMode = "on") still need to | 543 // some values (such as the case of designMode = "on") still need to |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1169 } | 1166 } |
1170 | 1167 |
1171 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc hResult& matchResult, Element* animatingElement) | 1168 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc hResult& matchResult, Element* animatingElement) |
1172 { | 1169 { |
1173 const Element* element = state.element(); | 1170 const Element* element = state.element(); |
1174 ASSERT(element); | 1171 ASSERT(element); |
1175 STYLE_STATS_ADD_MATCHED_PROPERTIES_SEARCH(); | 1172 STYLE_STATS_ADD_MATCHED_PROPERTIES_SEARCH(); |
1176 | 1173 |
1177 unsigned cacheHash = matchResult.isCacheable ? computeMatchedPropertiesHash( matchResult.matchedProperties.data(), matchResult.matchedProperties.size()) : 0; | 1174 unsigned cacheHash = matchResult.isCacheable ? computeMatchedPropertiesHash( matchResult.matchedProperties.data(), matchResult.matchedProperties.size()) : 0; |
1178 bool applyInheritedOnly = false; | 1175 bool applyInheritedOnly = false; |
1176 bool applyAnimatedOnly = false; | |
1179 const CachedMatchedProperties* cachedMatchedProperties = 0; | 1177 const CachedMatchedProperties* cachedMatchedProperties = 0; |
1180 | 1178 |
1181 if (cacheHash && (cachedMatchedProperties = m_matchedPropertiesCache.find(ca cheHash, state, matchResult)) | 1179 if (cacheHash && (cachedMatchedProperties = m_matchedPropertiesCache.find(ca cheHash, state, matchResult)) |
1182 && MatchedPropertiesCache::isCacheable(element, state.style(), state.par entStyle())) { | 1180 && MatchedPropertiesCache::isCacheable(element, state.style(), state.par entStyle())) { |
1183 STYLE_STATS_ADD_MATCHED_PROPERTIES_HIT(); | 1181 STYLE_STATS_ADD_MATCHED_PROPERTIES_HIT(); |
1184 // We can build up the style by copying non-inherited properties from an earlier style object built using the same exact | 1182 // We can build up the style by copying non-inherited properties from an earlier style object built using the same exact |
1185 // style declarations. We then only need to apply the inherited properti es, if any, as their values can depend on the | 1183 // style declarations. We then only need to apply the inherited properti es, if any, as their values can depend on the |
1186 // element context. This is fast and saves memory by reusing the style d ata structures. | 1184 // element context. This is fast and saves memory by reusing the style d ata structures. |
1187 state.style()->copyNonInheritedFrom(cachedMatchedProperties->renderStyle .get()); | 1185 state.style()->copyNonInheritedFrom(cachedMatchedProperties->renderStyle .get()); |
1188 if (state.parentStyle()->inheritedDataShared(cachedMatchedProperties->pa rentRenderStyle.get()) && !isAtShadowBoundary(element)) { | 1186 if (state.parentStyle()->inheritedDataShared(cachedMatchedProperties->pa rentRenderStyle.get()) && !isAtShadowBoundary(element)) { |
1189 STYLE_STATS_ADD_MATCHED_PROPERTIES_HIT_SHARED_INHERITED(); | 1187 STYLE_STATS_ADD_MATCHED_PROPERTIES_HIT_SHARED_INHERITED(); |
1190 | 1188 |
1191 EInsideLink linkStatus = state.style()->insideLink(); | 1189 EInsideLink linkStatus = state.style()->insideLink(); |
1192 // If the cache item parent style has identical inherited properties to the current parent style then the | 1190 // If the cache item parent style has identical inherited properties to the current parent style then the |
1193 // resulting style will be identical too. We copy the inherited prop erties over from the cache and are done. | 1191 // resulting style will be identical too. We copy the inherited prop erties over from the cache and are done. |
1194 state.style()->inheritFrom(cachedMatchedProperties->renderStyle.get( )); | 1192 state.style()->inheritFrom(cachedMatchedProperties->renderStyle.get( )); |
1195 | 1193 |
1196 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it. | 1194 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it. |
1197 state.style()->setInsideLink(linkStatus); | 1195 state.style()->setInsideLink(linkStatus); |
1198 return; | 1196 |
1197 if (RuntimeEnabledFeatures::webAnimationsEnabled()) { | |
Steve Block
2013/11/14 02:17:18
This should probably be WebAnimationsCSSEnabled()
dstockwell
2013/11/14 02:59:49
It's a bit mixed up, we could just kill the 'WebAn
Timothy Loh
2013/11/14 03:06:31
Erm; changed the callers in this file anyway.
| |
1198 applyAnimatedOnly = element->hasActiveAnimations() | |
dstockwell
2013/11/13 23:37:19
Would it be cleaner to pull out the application of
Steve Block
2013/11/14 02:17:18
Agreed
Timothy Loh
2013/11/14 03:06:31
Done. I wasn't sure if this would make it cleaner,
| |
1199 || (state.style()->transitions() && !state.style()->transiti ons()->isEmpty()) | |
1200 || (state.style()->animations() && !state.style()->animation s()->isEmpty()); | |
1201 } | |
1202 if (!applyAnimatedOnly) | |
1203 return; | |
1199 } | 1204 } |
1200 applyInheritedOnly = true; | 1205 applyInheritedOnly = true; |
1201 } | 1206 } |
1202 | 1207 |
1203 // First apply all variable definitions, as they may be used during applicat ion of later properties. | 1208 if (!applyAnimatedOnly) { |
1204 applyMatchedProperties<VariableDefinitions>(state, matchResult, false, 0, ma tchResult.matchedProperties.size() - 1, applyInheritedOnly); | 1209 // First apply all variable definitions, as they may be used during appl ication of later properties. |
1205 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, matchR esult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedO nly); | 1210 applyMatchedProperties<VariableDefinitions>(state, matchResult, false, 0 , matchResult.matchedProperties.size() - 1, applyInheritedOnly); |
1206 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, matchR esult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly) ; | 1211 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, ma tchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheri tedOnly); |
1207 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, matchR esult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | 1212 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, ma tchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedO nly); |
1213 applyMatchedProperties<VariableDefinitions>(state, matchResult, true, ma tchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly) ; | |
1208 | 1214 |
1209 // Apply animation properties in order to apply animation results and trigge r transitions below. | 1215 // Apply animation properties in order to apply animation results and tr igger transitions below. |
1210 applyMatchedProperties<AnimationProperties>(state, matchResult, false, 0, ma tchResult.matchedProperties.size() - 1, applyInheritedOnly); | 1216 applyMatchedProperties<AnimationProperties>(state, matchResult, false, 0 , matchResult.matchedProperties.size() - 1, applyInheritedOnly); |
1211 applyMatchedProperties<AnimationProperties>(state, matchResult, true, matchR esult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedO nly); | 1217 applyMatchedProperties<AnimationProperties>(state, matchResult, true, ma tchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheri tedOnly); |
1212 applyMatchedProperties<AnimationProperties>(state, matchResult, true, matchR esult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly) ; | 1218 applyMatchedProperties<AnimationProperties>(state, matchResult, true, ma tchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedO nly); |
1213 applyMatchedProperties<AnimationProperties>(state, matchResult, true, matchR esult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | 1219 applyMatchedProperties<AnimationProperties>(state, matchResult, true, ma tchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly) ; |
1214 | 1220 |
1215 // Match transition-property / animation-name length by trimming and | 1221 // Match transition-property / animation-name length by trimming and |
1216 // lengthening other transition / animation property lists | 1222 // lengthening other transition / animation property lists |
1217 // FIXME: This is wrong because we shouldn't affect the computed values | 1223 // FIXME: This is wrong because we shouldn't affect the computed values |
1218 state.style()->adjustAnimations(); | 1224 state.style()->adjustAnimations(); |
1219 state.style()->adjustTransitions(); | 1225 state.style()->adjustTransitions(); |
1220 | 1226 |
1221 // Now we have all of the matched rules in the appropriate order. Walk the r ules and apply | 1227 // Now we have all of the matched rules in the appropriate order. Walk t he rules and apply |
1222 // high-priority properties first, i.e., those properties that other propert ies depend on. | 1228 // high-priority properties first, i.e., those properties that other pro perties depend on. |
1223 // The order is (1) high-priority not important, (2) high-priority important , (3) normal not important | 1229 // The order is (1) high-priority not important, (2) high-priority impor tant, (3) normal not important |
1224 // and (4) normal important. | 1230 // and (4) normal important. |
1225 state.setLineHeightValue(0); | 1231 state.setLineHeightValue(0); |
1226 applyMatchedProperties<HighPriorityProperties>(state, matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly); | 1232 applyMatchedProperties<HighPriorityProperties>(state, matchResult, false , 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly); |
1227 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat chResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherit edOnly); | 1233 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInh eritedOnly); |
1228 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat chResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOn ly); | 1234 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInherit edOnly); |
1229 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat chResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | 1235 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOn ly); |
1230 | 1236 |
1231 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->effecti veZoom() != state.style()->effectiveZoom()) { | 1237 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->eff ectiveZoom() != state.style()->effectiveZoom()) { |
1232 state.fontBuilder().setFontDirty(true); | 1238 state.fontBuilder().setFontDirty(true); |
1233 applyInheritedOnly = false; | 1239 applyInheritedOnly = false; |
1240 } | |
1241 | |
1242 // If our font got dirtied, go ahead and update it now. | |
1243 updateFont(state); | |
1244 | |
1245 // Line-height is set when we are sure we decided on the font-size. | |
1246 if (state.lineHeightValue()) | |
1247 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.line HeightValue()); | |
1248 | |
1249 // Many properties depend on the font. If it changes we just apply all p roperties. | |
1250 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->fon tDescription() != state.style()->fontDescription()) | |
1251 applyInheritedOnly = false; | |
1252 | |
1253 // Now do the normal priority UA properties. | |
1254 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOn ly); | |
1255 | |
1256 // Cache the UA properties to pass them to RenderTheme in adjustRenderSt yle. | |
1257 state.cacheUserAgentBorderAndBackground(); | |
1258 | |
1259 // Now do the author and user normal priority properties and all the !im portant properties. | |
1260 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, ap plyInheritedOnly); | |
1261 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInhe ritedOnly); | |
1262 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInherite dOnly); | |
1263 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnl y); | |
1264 | |
1265 // Start loading resources referenced by this style. | |
1266 m_styleResourceLoader.loadPendingResources(state.style(), state.elementS tyleResources()); | |
1267 | |
1268 #ifdef STYLE_STATS | |
1269 if (!cachedMatchedProperties) | |
1270 STYLE_STATS_ADD_MATCHED_PROPERTIES_TO_CACHE(); | |
1271 #endif | |
1272 | |
1273 if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isC acheable(element, state.style(), state.parentStyle())) { | |
1274 STYLE_STATS_ADD_MATCHED_PROPERTIES_ENTERED_INTO_CACHE(); | |
1275 m_matchedPropertiesCache.add(state.style(), state.parentStyle(), cac heHash, matchResult); | |
1276 } | |
1234 } | 1277 } |
1235 | 1278 |
1236 // If our font got dirtied, go ahead and update it now. | |
1237 updateFont(state); | |
1238 | |
1239 // Line-height is set when we are sure we decided on the font-size. | |
1240 if (state.lineHeightValue()) | |
1241 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig htValue()); | |
1242 | |
1243 // Many properties depend on the font. If it changes we just apply all prope rties. | |
1244 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->fontDes cription() != state.style()->fontDescription()) | |
1245 applyInheritedOnly = false; | |
1246 | |
1247 // Now do the normal priority UA properties. | |
1248 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, mat chResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | |
1249 | |
1250 // Cache the UA properties to pass them to RenderTheme in adjustRenderStyle. | |
1251 state.cacheUserAgentBorderAndBackground(); | |
1252 | |
1253 // Now do the author and user normal priority properties and all the !import ant properties. | |
1254 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, mat chResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyI nheritedOnly); | |
1255 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherite dOnly); | |
1256 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnl y); | |
1257 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | |
1258 | |
1259 // animatingElement may be null, for example if we're calculating the | 1279 // animatingElement may be null, for example if we're calculating the |
1260 // style for a potential pseudo element that has yet to be created. | 1280 // style for a potential pseudo element that has yet to be created. |
1261 if (RuntimeEnabledFeatures::webAnimationsEnabled() && animatingElement) { | 1281 if (RuntimeEnabledFeatures::webAnimationsEnabled() && animatingElement) { |
1262 state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement , *state.style(), this)); | 1282 state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement , *state.style(), this)); |
1263 if (state.animationUpdate()) { | 1283 if (state.animationUpdate()) { |
1264 ASSERT(!applyInheritedOnly); | |
1265 const AnimationEffect::CompositableValueMap& compositableValuesForAn imations = state.animationUpdate()->compositableValuesForAnimations(); | 1284 const AnimationEffect::CompositableValueMap& compositableValuesForAn imations = state.animationUpdate()->compositableValuesForAnimations(); |
1266 const AnimationEffect::CompositableValueMap& compositableValuesForTr ansitions = state.animationUpdate()->compositableValuesForTransitions(); | 1285 const AnimationEffect::CompositableValueMap& compositableValuesForTr ansitions = state.animationUpdate()->compositableValuesForTransitions(); |
1267 // Apply animated properties, then reapply any rules marked importan t. | 1286 applyAnimatedProperties<HighPriorityProperties>(state, compositableV aluesForAnimations); |
1268 if (applyAnimatedProperties<HighPriorityProperties>(state, composita bleValuesForAnimations)) { | |
1269 bool important = true; | |
1270 applyMatchedProperties<HighPriorityProperties>(state, matchResul t, important, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorR ule, applyInheritedOnly); | |
1271 applyMatchedProperties<HighPriorityProperties>(state, matchResul t, important, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); | |
1272 applyMatchedProperties<HighPriorityProperties>(state, matchResul t, important, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, app lyInheritedOnly); | |
1273 } | |
1274 applyAnimatedProperties<HighPriorityProperties>(state, compositableV aluesForTransitions); | 1287 applyAnimatedProperties<HighPriorityProperties>(state, compositableV aluesForTransitions); |
1275 if (applyAnimatedProperties<LowPriorityProperties>(state, compositab leValuesForAnimations)) { | 1288 applyAnimatedProperties<LowPriorityProperties>(state, compositableVa luesForAnimations); |
1276 bool important = true; | |
1277 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRu le, applyInheritedOnly); | |
1278 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); | |
1279 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, appl yInheritedOnly); | |
1280 } | |
1281 applyAnimatedProperties<LowPriorityProperties>(state, compositableVa luesForTransitions); | 1289 applyAnimatedProperties<LowPriorityProperties>(state, compositableVa luesForTransitions); |
1282 } | 1290 } |
1283 } | 1291 } |
1284 | 1292 |
1285 // Start loading resources referenced by this style. | |
1286 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); | |
1287 | |
1288 ASSERT(!state.fontBuilder().fontDirty()); | 1293 ASSERT(!state.fontBuilder().fontDirty()); |
1289 | |
1290 #ifdef STYLE_STATS | |
1291 if (!cachedMatchedProperties) | |
1292 STYLE_STATS_ADD_MATCHED_PROPERTIES_TO_CACHE(); | |
1293 #endif | |
1294 | |
1295 if (cachedMatchedProperties || !cacheHash) | |
1296 return; | |
1297 if (!MatchedPropertiesCache::isCacheable(element, state.style(), state.paren tStyle())) | |
1298 return; | |
1299 STYLE_STATS_ADD_MATCHED_PROPERTIES_ENTERED_INTO_CACHE(); | |
1300 m_matchedPropertiesCache.add(state.style(), state.parentStyle(), cacheHash, matchResult); | |
1301 } | 1294 } |
1302 | 1295 |
1303 CSSPropertyValue::CSSPropertyValue(CSSPropertyID id, const StylePropertySet& pro pertySet) | 1296 CSSPropertyValue::CSSPropertyValue(CSSPropertyID id, const StylePropertySet& pro pertySet) |
1304 : property(id), value(propertySet.getPropertyCSSValue(id).get()) | 1297 : property(id), value(propertySet.getPropertyCSSValue(id).get()) |
1305 { } | 1298 { } |
1306 | 1299 |
1307 void StyleResolver::applyPropertiesToStyle(const CSSPropertyValue* properties, s ize_t count, RenderStyle* style) | 1300 void StyleResolver::applyPropertiesToStyle(const CSSPropertyValue* properties, s ize_t count, RenderStyle* style) |
1308 { | 1301 { |
1309 StyleResolverState state(document(), document().documentElement(), style); | 1302 StyleResolverState state(document(), document().documentElement(), style); |
1310 state.setStyle(style); | 1303 state.setStyle(style); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1368 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che); | 1361 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che); |
1369 | 1362 |
1370 fprintf(stderr, "Total:\n"); | 1363 fprintf(stderr, "Total:\n"); |
1371 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, | 1364 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, |
1372 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache); | 1365 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache); |
1373 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); | 1366 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); |
1374 } | 1367 } |
1375 #endif | 1368 #endif |
1376 | 1369 |
1377 } // namespace WebCore | 1370 } // namespace WebCore |
OLD | NEW |