| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 matchRuleSet(collector, userAgentStyleSheet); | 406 matchRuleSet(collector, userAgentStyleSheet); |
| 407 | 407 |
| 408 // In quirks mode, we match rules from the quirks user agent sheet. | 408 // In quirks mode, we match rules from the quirks user agent sheet. |
| 409 if (document().inQuirksMode()) | 409 if (document().inQuirksMode()) |
| 410 matchRuleSet(collector, defaultStyleSheets.defaultQuirksStyle()); | 410 matchRuleSet(collector, defaultStyleSheets.defaultQuirksStyle()); |
| 411 | 411 |
| 412 // If document uses view source styles (in view source mode or in xml viewer
mode), then we match rules from the view source style sheet. | 412 // If document uses view source styles (in view source mode or in xml viewer
mode), then we match rules from the view source style sheet. |
| 413 if (document().isViewSource()) | 413 if (document().isViewSource()) |
| 414 matchRuleSet(collector, defaultStyleSheets.defaultViewSourceStyle()); | 414 matchRuleSet(collector, defaultStyleSheets.defaultViewSourceStyle()); |
| 415 | 415 |
| 416 collector.finishAddingUARules(); | |
| 417 collector.setMatchingUARules(false); | 416 collector.setMatchingUARules(false); |
| 418 } | 417 } |
| 419 | 418 |
| 420 void StyleResolver::matchRuleSet(ElementRuleCollector& collector, RuleSet* rules
) | 419 void StyleResolver::matchRuleSet(ElementRuleCollector& collector, RuleSet* rules
) |
| 421 { | 420 { |
| 422 collector.clearMatchedRules(); | 421 collector.clearMatchedRules(); |
| 423 collector.collectMatchingRules(MatchRequest(rules)); | 422 collector.collectMatchingRules(MatchRequest(rules)); |
| 424 collector.sortAndTransferMatchedRules(); | 423 collector.sortAndTransferMatchedRules(); |
| 425 } | 424 } |
| 426 | 425 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 453 if (state.element()->inlineStyle()) { | 452 if (state.element()->inlineStyle()) { |
| 454 // Inline style is immutable as long as there is no CSSOM wrapper. | 453 // Inline style is immutable as long as there is no CSSOM wrapper. |
| 455 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut
able(); | 454 bool isInlineStyleCacheable = !state.element()->inlineStyle()->isMut
able(); |
| 456 collector.addElementStyleProperties(state.element()->inlineStyle(),
isInlineStyleCacheable); | 455 collector.addElementStyleProperties(state.element()->inlineStyle(),
isInlineStyleCacheable); |
| 457 } | 456 } |
| 458 | 457 |
| 459 // Now check SMIL animation override style. | 458 // Now check SMIL animation override style. |
| 460 if (includeSMILProperties && state.element()->isSVGElement()) | 459 if (includeSMILProperties && state.element()->isSVGElement()) |
| 461 collector.addElementStyleProperties(toSVGElement(state.element())->a
nimatedSMILStyleProperties(), false /* isCacheable */); | 460 collector.addElementStyleProperties(toSVGElement(state.element())->a
nimatedSMILStyleProperties(), false /* isCacheable */); |
| 462 } | 461 } |
| 463 | |
| 464 collector.finishAddingAuthorRulesForTreeScope(); | |
| 465 } | 462 } |
| 466 | 463 |
| 467 PassRefPtr<ComputedStyle> StyleResolver::styleForDocument(Document& document) | 464 PassRefPtr<ComputedStyle> StyleResolver::styleForDocument(Document& document) |
| 468 { | 465 { |
| 469 const LocalFrame* frame = document.frame(); | 466 const LocalFrame* frame = document.frame(); |
| 470 | 467 |
| 471 RefPtr<ComputedStyle> documentStyle = ComputedStyle::create(); | 468 RefPtr<ComputedStyle> documentStyle = ComputedStyle::create(); |
| 472 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : Log
icalOrder); | 469 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : Log
icalOrder); |
| 473 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor
() : 1); | 470 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor
() : 1); |
| 474 documentStyle->setLocale(document.contentLanguage()); | 471 documentStyle->setLocale(document.contentLanguage()); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 // Since we don't use pseudo-elements in any of our quirk/print | 749 // Since we don't use pseudo-elements in any of our quirk/print |
| 753 // user agent rules, don't waste time walking those rules. | 750 // user agent rules, don't waste time walking those rules. |
| 754 | 751 |
| 755 if (!baseComputedStyle) { | 752 if (!baseComputedStyle) { |
| 756 // Check UA, user and author rules. | 753 // Check UA, user and author rules. |
| 757 ElementRuleCollector collector(state.elementContext(), m_selectorFilter,
state.style()); | 754 ElementRuleCollector collector(state.elementContext(), m_selectorFilter,
state.style()); |
| 758 collector.setPseudoStyleRequest(pseudoStyleRequest); | 755 collector.setPseudoStyleRequest(pseudoStyleRequest); |
| 759 | 756 |
| 760 matchUARules(collector); | 757 matchUARules(collector); |
| 761 matchAuthorRules(state.element(), collector, false); | 758 matchAuthorRules(state.element(), collector, false); |
| 762 collector.finishAddingAuthorRulesForTreeScope(); | |
| 763 | 759 |
| 764 if (!collector.matchedResult().hasMatchedProperties()) | 760 if (collector.matchedResult().matchedProperties.isEmpty()) |
| 765 return false; | 761 return false; |
| 766 | 762 |
| 767 applyMatchedProperties(state, collector.matchedResult()); | 763 applyMatchedProperties(state, collector.matchedResult()); |
| 768 applyCallbackSelectors(state); | 764 applyCallbackSelectors(state); |
| 769 | 765 |
| 770 // Cache our original display. | 766 // Cache our original display. |
| 771 state.style()->setOriginalDisplay(state.style()->display()); | 767 state.style()->setOriginalDisplay(state.style()->display()); |
| 772 | 768 |
| 773 // FIXME: Passing 0 as the Element* introduces a lot of complexity | 769 // FIXME: Passing 0 as the Element* introduces a lot of complexity |
| 774 // in the adjustComputedStyle code. | 770 // in the adjustComputedStyle code. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 PageRuleCollector collector(rootElementStyle, pageIndex); | 823 PageRuleCollector collector(rootElementStyle, pageIndex); |
| 828 | 824 |
| 829 collector.matchPageRules(CSSDefaultStyleSheets::instance().defaultPrintStyle
()); | 825 collector.matchPageRules(CSSDefaultStyleSheets::instance().defaultPrintStyle
()); |
| 830 | 826 |
| 831 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver()) | 827 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver()) |
| 832 scopedResolver->matchPageRules(collector); | 828 scopedResolver->matchPageRules(collector); |
| 833 | 829 |
| 834 bool inheritedOnly = false; | 830 bool inheritedOnly = false; |
| 835 | 831 |
| 836 const MatchResult& result = collector.matchedResult(); | 832 const MatchResult& result = collector.matchedResult(); |
| 837 applyMatchedProperties<HighPropertyPriority>(state, result.allRules(), false
, inheritedOnly); | 833 applyMatchedProperties<HighPropertyPriority>(state, result, false, result.be
gin(), result.end(), inheritedOnly); |
| 838 | 834 |
| 839 // If our font got dirtied, go ahead and update it now. | 835 // If our font got dirtied, go ahead and update it now. |
| 840 updateFont(state); | 836 updateFont(state); |
| 841 | 837 |
| 842 applyMatchedProperties<LowPropertyPriority>(state, result.allRules(), false,
inheritedOnly); | 838 applyMatchedProperties<LowPropertyPriority>(state, result, false, result.beg
in(), result.end(), inheritedOnly); |
| 843 | 839 |
| 844 loadPendingResources(state); | 840 loadPendingResources(state); |
| 845 | 841 |
| 846 didAccess(); | 842 didAccess(); |
| 847 | 843 |
| 848 // Now return the style. | 844 // Now return the style. |
| 849 return state.takeStyle(); | 845 return state.takeStyle(); |
| 850 } | 846 } |
| 851 | 847 |
| 852 PassRefPtr<ComputedStyle> StyleResolver::initialStyleForElement() | 848 PassRefPtr<ComputedStyle> StyleResolver::initialStyleForElement() |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 } | 1226 } |
| 1231 | 1227 |
| 1232 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) | 1228 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) |
| 1233 continue; | 1229 continue; |
| 1234 | 1230 |
| 1235 StyleBuilder::applyProperty(current.id(), state, current.value()); | 1231 StyleBuilder::applyProperty(current.id(), state, current.value()); |
| 1236 } | 1232 } |
| 1237 } | 1233 } |
| 1238 | 1234 |
| 1239 template <CSSPropertyPriority priority> | 1235 template <CSSPropertyPriority priority> |
| 1240 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
hedPropertiesRange& range, bool isImportant, bool inheritedOnly) | 1236 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
hResult& matchResult, bool isImportant, unsigned startIndex, unsigned endIndex,
bool inheritedOnly) |
| 1241 { | 1237 { |
| 1242 if (range.isEmpty()) | 1238 if (startIndex == endIndex) |
| 1243 return; | 1239 return; |
| 1244 | 1240 |
| 1241 ASSERT_WITH_SECURITY_IMPLICATION(endIndex <= matchResult.matchedProperties.s
ize()); |
| 1242 |
| 1245 if (state.style()->insideLink() != NotInsideLink) { | 1243 if (state.style()->insideLink() != NotInsideLink) { |
| 1246 for (const auto& matchedProperties : range) { | 1244 for (unsigned i = startIndex; i < endIndex; ++i) { |
| 1245 const MatchedProperties& matchedProperties = matchResult.matchedProp
erties[i]; |
| 1247 unsigned linkMatchType = matchedProperties.m_types.linkMatchType; | 1246 unsigned linkMatchType = matchedProperties.m_types.linkMatchType; |
| 1248 // FIXME: It would be nicer to pass these as arguments but that requ
ires changes in many places. | 1247 // FIXME: It would be nicer to pass these as arguments but that requ
ires changes in many places. |
| 1249 state.setApplyPropertyToRegularStyle(linkMatchType & CSSSelector::Ma
tchLink); | 1248 state.setApplyPropertyToRegularStyle(linkMatchType & CSSSelector::Ma
tchLink); |
| 1250 state.setApplyPropertyToVisitedLinkStyle(linkMatchType & CSSSelector
::MatchVisited); | 1249 state.setApplyPropertyToVisitedLinkStyle(linkMatchType & CSSSelector
::MatchVisited); |
| 1251 | 1250 |
| 1252 applyProperties<priority>(state, matchedProperties.properties.get(),
isImportant, inheritedOnly, static_cast<PropertyWhitelistType>(matchedPropertie
s.m_types.whitelistType)); | 1251 applyProperties<priority>(state, matchedProperties.properties.get(),
isImportant, inheritedOnly, static_cast<PropertyWhitelistType>(matchedPropertie
s.m_types.whitelistType)); |
| 1253 } | 1252 } |
| 1254 state.setApplyPropertyToRegularStyle(true); | 1253 state.setApplyPropertyToRegularStyle(true); |
| 1255 state.setApplyPropertyToVisitedLinkStyle(false); | 1254 state.setApplyPropertyToVisitedLinkStyle(false); |
| 1256 return; | 1255 return; |
| 1257 } | 1256 } |
| 1258 for (const auto& matchedProperties : range) | 1257 for (unsigned i = startIndex; i < endIndex; ++i) { |
| 1258 const MatchedProperties& matchedProperties = matchResult.matchedProperti
es[i]; |
| 1259 applyProperties<priority>(state, matchedProperties.properties.get(), isI
mportant, inheritedOnly, static_cast<PropertyWhitelistType>(matchedProperties.m_
types.whitelistType)); | 1259 applyProperties<priority>(state, matchedProperties.properties.get(), isI
mportant, inheritedOnly, static_cast<PropertyWhitelistType>(matchedProperties.m_
types.whitelistType)); |
| 1260 } |
| 1260 } | 1261 } |
| 1261 | 1262 |
| 1262 static unsigned computeMatchedPropertiesHash(const MatchedProperties* properties
, unsigned size) | 1263 static unsigned computeMatchedPropertiesHash(const MatchedProperties* properties
, unsigned size) |
| 1263 { | 1264 { |
| 1264 return StringHasher::hashMemory(properties, sizeof(MatchedProperties) * size
); | 1265 return StringHasher::hashMemory(properties, sizeof(MatchedProperties) * size
); |
| 1265 } | 1266 } |
| 1266 | 1267 |
| 1267 void StyleResolver::invalidateMatchedPropertiesCache() | 1268 void StyleResolver::invalidateMatchedPropertiesCache() |
| 1268 { | 1269 { |
| 1269 m_matchedPropertiesCache.clear(); | 1270 m_matchedPropertiesCache.clear(); |
| 1270 } | 1271 } |
| 1271 | 1272 |
| 1272 void StyleResolver::notifyResizeForViewportUnits() | 1273 void StyleResolver::notifyResizeForViewportUnits() |
| 1273 { | 1274 { |
| 1274 m_viewportStyleResolver->collectViewportRules(); | 1275 m_viewportStyleResolver->collectViewportRules(); |
| 1275 m_matchedPropertiesCache.clearViewportDependent(); | 1276 m_matchedPropertiesCache.clearViewportDependent(); |
| 1276 } | 1277 } |
| 1277 | 1278 |
| 1278 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
hResult& matchResult) | 1279 void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
hResult& matchResult) |
| 1279 { | 1280 { |
| 1280 const Element* element = state.element(); | 1281 const Element* element = state.element(); |
| 1281 ASSERT(element); | 1282 ASSERT(element); |
| 1282 | 1283 |
| 1283 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyApply, 1); | 1284 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyApply, 1); |
| 1284 | 1285 |
| 1285 unsigned cacheHash = matchResult.isCacheable() ? computeMatchedPropertiesHas
h(matchResult.matchedProperties().data(), matchResult.matchedProperties().size()
) : 0; | 1286 unsigned cacheHash = matchResult.isCacheable ? computeMatchedPropertiesHash(
matchResult.matchedProperties.data(), matchResult.matchedProperties.size()) : 0; |
| 1286 bool applyInheritedOnly = false; | 1287 bool applyInheritedOnly = false; |
| 1287 const CachedMatchedProperties* cachedMatchedProperties = cacheHash ? m_match
edPropertiesCache.find(cacheHash, state, matchResult.matchedProperties()) : 0; | 1288 const CachedMatchedProperties* cachedMatchedProperties = cacheHash ? m_match
edPropertiesCache.find(cacheHash, state, matchResult) : 0; |
| 1288 | 1289 |
| 1289 if (cachedMatchedProperties && MatchedPropertiesCache::isCacheable(element,
*state.style(), *state.parentStyle())) { | 1290 if (cachedMatchedProperties && MatchedPropertiesCache::isCacheable(element,
*state.style(), *state.parentStyle())) { |
| 1290 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheHit, 1); | 1291 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheHit, 1); |
| 1291 // We can build up the style by copying non-inherited properties from an
earlier style object built using the same exact | 1292 // We can build up the style by copying non-inherited properties from an
earlier style object built using the same exact |
| 1292 // style declarations. We then only need to apply the inherited properti
es, if any, as their values can depend on the | 1293 // style declarations. We then only need to apply the inherited properti
es, if any, as their values can depend on the |
| 1293 // element context. This is fast and saves memory by reusing the style d
ata structures. | 1294 // element context. This is fast and saves memory by reusing the style d
ata structures. |
| 1294 state.style()->copyNonInheritedFromCached(*cachedMatchedProperties->comp
utedStyle); | 1295 state.style()->copyNonInheritedFromCached(*cachedMatchedProperties->comp
utedStyle); |
| 1295 if (state.parentStyle()->inheritedDataShared(*cachedMatchedProperties->p
arentComputedStyle) && !isAtShadowBoundary(element) | 1296 if (state.parentStyle()->inheritedDataShared(*cachedMatchedProperties->p
arentComputedStyle) && !isAtShadowBoundary(element) |
| 1296 && (!state.distributedToInsertionPoint() || state.style()->userModif
y() == READ_ONLY)) { | 1297 && (!state.distributedToInsertionPoint() || state.style()->userModif
y() == READ_ONLY)) { |
| 1297 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheInheritedHi
t, 1); | 1298 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheInheritedHi
t, 1); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1308 | 1309 |
| 1309 return; | 1310 return; |
| 1310 } | 1311 } |
| 1311 applyInheritedOnly = true; | 1312 applyInheritedOnly = true; |
| 1312 } | 1313 } |
| 1313 | 1314 |
| 1314 // Now we have all of the matched rules in the appropriate order. Walk the r
ules and apply | 1315 // Now we have all of the matched rules in the appropriate order. Walk the r
ules and apply |
| 1315 // high-priority properties first, i.e., those properties that other propert
ies depend on. | 1316 // high-priority properties first, i.e., those properties that other propert
ies depend on. |
| 1316 // The order is (1) high-priority not important, (2) high-priority important
, (3) normal not important | 1317 // The order is (1) high-priority not important, (2) high-priority important
, (3) normal not important |
| 1317 // and (4) normal important. | 1318 // and (4) normal important. |
| 1318 applyMatchedProperties<HighPropertyPriority>(state, matchResult.allRules(),
false, applyInheritedOnly); | 1319 applyMatchedProperties<HighPropertyPriority>(state, matchResult, false, matc
hResult.begin(), matchResult.end(), applyInheritedOnly); |
| 1319 for (auto range : ImportantAuthorRanges(matchResult)) | 1320 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match
Result.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly); |
| 1320 applyMatchedProperties<HighPropertyPriority>(state, range, true, applyIn
heritedOnly); | 1321 applyMatchedProperties<HighPropertyPriority>(state, matchResult, true, match
Result.beginUA(), matchResult.endUA(), applyInheritedOnly); |
| 1321 applyMatchedProperties<HighPropertyPriority>(state, matchResult.uaRules(), t
rue, applyInheritedOnly); | |
| 1322 | 1322 |
| 1323 if (UNLIKELY(isSVGForeignObjectElement(element))) { | 1323 if (UNLIKELY(isSVGForeignObjectElement(element))) { |
| 1324 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should not be scaled again. | 1324 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should not be scaled again. |
| 1325 // | 1325 // |
| 1326 // FIXME: The following hijacks the zoom property for foreignObject so t
hat children of foreignObject get the | 1326 // FIXME: The following hijacks the zoom property for foreignObject so t
hat children of foreignObject get the |
| 1327 // correct font-size in case of zooming. 'zoom' has HighPropertyPriority
, along with other font-related | 1327 // correct font-size in case of zooming. 'zoom' has HighPropertyPriority
, along with other font-related |
| 1328 // properties used as input to the FontBuilder, so resetting it here may
cause the FontBuilder to recompute the | 1328 // properties used as input to the FontBuilder, so resetting it here may
cause the FontBuilder to recompute the |
| 1329 // font used as inheritable font for foreignObject content. If we want t
o support zoom on foreignObject we'll | 1329 // font used as inheritable font for foreignObject content. If we want t
o support zoom on foreignObject we'll |
| 1330 // need to find another way of handling the SVG zoom model. | 1330 // need to find another way of handling the SVG zoom model. |
| 1331 state.setEffectiveZoom(ComputedStyle::initialZoom()); | 1331 state.setEffectiveZoom(ComputedStyle::initialZoom()); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->effec
tiveZoom() != state.style()->effectiveZoom()) { | 1334 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->effec
tiveZoom() != state.style()->effectiveZoom()) { |
| 1335 state.fontBuilder().didChangeEffectiveZoom(); | 1335 state.fontBuilder().didChangeEffectiveZoom(); |
| 1336 applyInheritedOnly = false; | 1336 applyInheritedOnly = false; |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 // If our font got dirtied, go ahead and update it now. | 1339 // If our font got dirtied, go ahead and update it now. |
| 1340 updateFont(state); | 1340 updateFont(state); |
| 1341 | 1341 |
| 1342 // Many properties depend on the font. If it changes we just apply all prope
rties. | 1342 // Many properties depend on the font. If it changes we just apply all prope
rties. |
| 1343 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->fontD
escription() != state.style()->fontDescription()) | 1343 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->fontD
escription() != state.style()->fontDescription()) |
| 1344 applyInheritedOnly = false; | 1344 applyInheritedOnly = false; |
| 1345 | 1345 |
| 1346 // Now do the normal priority UA properties. | 1346 // Now do the normal priority UA properties. |
| 1347 applyMatchedProperties<LowPropertyPriority>(state, matchResult.uaRules(), fa
lse, applyInheritedOnly); | 1347 applyMatchedProperties<LowPropertyPriority>(state, matchResult, false, match
Result.beginUA(), matchResult.endUA(), applyInheritedOnly); |
| 1348 | 1348 |
| 1349 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyl
e. | 1349 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyl
e. |
| 1350 state.cacheUserAgentBorderAndBackground(); | 1350 state.cacheUserAgentBorderAndBackground(); |
| 1351 | 1351 |
| 1352 // Now do the author and user normal priority properties and all the !import
ant properties. | 1352 // Now do the author and user normal priority properties and all the !import
ant properties. |
| 1353 applyMatchedProperties<LowPropertyPriority>(state, matchResult.authorRules()
, false, applyInheritedOnly); | 1353 applyMatchedProperties<LowPropertyPriority>(state, matchResult, false, match
Result.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly); |
| 1354 for (auto range : ImportantAuthorRanges(matchResult)) | 1354 applyMatchedProperties<LowPropertyPriority>(state, matchResult, true, matchR
esult.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly); |
| 1355 applyMatchedProperties<LowPropertyPriority>(state, range, true, applyInh
eritedOnly); | 1355 applyMatchedProperties<LowPropertyPriority>(state, matchResult, true, matchR
esult.beginUA(), matchResult.endUA(), applyInheritedOnly); |
| 1356 applyMatchedProperties<LowPropertyPriority>(state, matchResult.uaRules(), tr
ue, applyInheritedOnly); | |
| 1357 | 1356 |
| 1358 loadPendingResources(state); | 1357 loadPendingResources(state); |
| 1359 | 1358 |
| 1360 if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCache
able(element, *state.style(), *state.parentStyle())) { | 1359 if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCache
able(element, *state.style(), *state.parentStyle())) { |
| 1361 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded, 1); | 1360 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded, 1); |
| 1362 m_matchedPropertiesCache.add(*state.style(), *state.parentStyle(), cache
Hash, matchResult.matchedProperties()); | 1361 m_matchedPropertiesCache.add(*state.style(), *state.parentStyle(), cache
Hash, matchResult); |
| 1363 } | 1362 } |
| 1364 | 1363 |
| 1365 ASSERT(!state.fontBuilder().fontDirty()); | 1364 ASSERT(!state.fontBuilder().fontDirty()); |
| 1366 } | 1365 } |
| 1367 | 1366 |
| 1368 void StyleResolver::applyCallbackSelectors(StyleResolverState& state) | 1367 void StyleResolver::applyCallbackSelectors(StyleResolverState& state) |
| 1369 { | 1368 { |
| 1370 if (!m_watchedSelectorsRules) | 1369 if (!m_watchedSelectorsRules) |
| 1371 return; | 1370 return; |
| 1372 | 1371 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1448 visitor->trace(m_watchedSelectorsRules); | 1447 visitor->trace(m_watchedSelectorsRules); |
| 1449 visitor->trace(m_treeBoundaryCrossingRules); | 1448 visitor->trace(m_treeBoundaryCrossingRules); |
| 1450 visitor->trace(m_styleResourceLoader); | 1449 visitor->trace(m_styleResourceLoader); |
| 1451 visitor->trace(m_styleSharingLists); | 1450 visitor->trace(m_styleSharingLists); |
| 1452 visitor->trace(m_pendingStyleSheets); | 1451 visitor->trace(m_pendingStyleSheets); |
| 1453 visitor->trace(m_document); | 1452 visitor->trace(m_document); |
| 1454 #endif | 1453 #endif |
| 1455 } | 1454 } |
| 1456 | 1455 |
| 1457 } // namespace blink | 1456 } // namespace blink |
| OLD | NEW |