| 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. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 collector.matchPageRules( | 1014 collector.matchPageRules( |
| 1015 CSSDefaultStyleSheets::instance().defaultPrintStyle()); | 1015 CSSDefaultStyleSheets::instance().defaultPrintStyle()); |
| 1016 | 1016 |
| 1017 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver()) | 1017 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver()) |
| 1018 scopedResolver->matchPageRules(collector); | 1018 scopedResolver->matchPageRules(collector); |
| 1019 | 1019 |
| 1020 bool inheritedOnly = false; | 1020 bool inheritedOnly = false; |
| 1021 | 1021 |
| 1022 NeedsApplyPass needsApplyPass; | 1022 NeedsApplyPass needsApplyPass; |
| 1023 const MatchResult& result = collector.matchedResult(); | 1023 const MatchResult& result = collector.matchedResult(); |
| 1024 applyMatchedProperties<HighPropertyPriority>(state, result.allRules(), false, | 1024 applyMatchedProperties<HighPropertyPriority, UpdateNeedsApplyPass>( |
| 1025 inheritedOnly, needsApplyPass); | 1025 state, result.allRules(), false, inheritedOnly, needsApplyPass); |
| 1026 | 1026 |
| 1027 // If our font got dirtied, go ahead and update it now. | 1027 // If our font got dirtied, go ahead and update it now. |
| 1028 updateFont(state); | 1028 updateFont(state); |
| 1029 | 1029 |
| 1030 applyMatchedProperties<LowPropertyPriority>(state, result.allRules(), false, | 1030 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( |
| 1031 inheritedOnly, needsApplyPass); | 1031 state, result.allRules(), false, inheritedOnly, needsApplyPass); |
| 1032 | 1032 |
| 1033 loadPendingResources(state); | 1033 loadPendingResources(state); |
| 1034 | 1034 |
| 1035 // Now return the style. | 1035 // Now return the style. |
| 1036 return state.takeStyle(); | 1036 return state.takeStyle(); |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 PassRefPtr<ComputedStyle> StyleResolver::initialStyleForElement() { | 1039 PassRefPtr<ComputedStyle> StyleResolver::initialStyleForElement() { |
| 1040 RefPtr<ComputedStyle> style = ComputedStyle::create(); | 1040 RefPtr<ComputedStyle> style = ComputedStyle::create(); |
| 1041 FontBuilder fontBuilder(document()); | 1041 FontBuilder fontBuilder(document()); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 | 1459 |
| 1460 // When hitting matched properties' cache, only inherited properties will be | 1460 // When hitting matched properties' cache, only inherited properties will be |
| 1461 // applied. | 1461 // applied. |
| 1462 if (inheritedOnly && !CSSPropertyMetadata::isInheritedProperty(propertyId)) | 1462 if (inheritedOnly && !CSSPropertyMetadata::isInheritedProperty(propertyId)) |
| 1463 continue; | 1463 continue; |
| 1464 | 1464 |
| 1465 StyleBuilder::applyProperty(propertyId, state, allValue); | 1465 StyleBuilder::applyProperty(propertyId, state, allValue); |
| 1466 } | 1466 } |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 template <CSSPropertyPriority priority> | 1469 template <CSSPropertyPriority priority, |
| 1470 StyleResolver::ShouldUpdateNeedsApplyPass shouldUpdateNeedsApplyPass> |
| 1470 void StyleResolver::applyPropertiesForApplyAtRule( | 1471 void StyleResolver::applyPropertiesForApplyAtRule( |
| 1471 StyleResolverState& state, | 1472 StyleResolverState& state, |
| 1472 const CSSValue& value, | 1473 const CSSValue& value, |
| 1473 bool isImportant, | 1474 bool isImportant, |
| 1474 NeedsApplyPass& needsApplyPass, | 1475 NeedsApplyPass& needsApplyPass, |
| 1475 PropertyWhitelistType propertyWhitelistType) { | 1476 PropertyWhitelistType propertyWhitelistType) { |
| 1476 state.style()->setHasVariableReferenceFromNonInheritedProperty(); | 1477 state.style()->setHasVariableReferenceFromNonInheritedProperty(); |
| 1477 if (!state.style()->inheritedVariables()) | 1478 if (!state.style()->inheritedVariables()) |
| 1478 return; | 1479 return; |
| 1479 const String& name = toCSSCustomIdentValue(value).value(); | 1480 const String& name = toCSSCustomIdentValue(value).value(); |
| 1480 const StylePropertySet* propertySet = | 1481 const StylePropertySet* propertySet = |
| 1481 state.customPropertySetForApplyAtRule(name); | 1482 state.customPropertySetForApplyAtRule(name); |
| 1482 bool inheritedOnly = false; | 1483 bool inheritedOnly = false; |
| 1483 if (propertySet) { | 1484 if (propertySet) { |
| 1484 applyProperties<priority>(state, propertySet, isImportant, inheritedOnly, | 1485 applyProperties<priority, shouldUpdateNeedsApplyPass>( |
| 1485 needsApplyPass, propertyWhitelistType); | 1486 state, propertySet, isImportant, inheritedOnly, needsApplyPass, |
| 1487 propertyWhitelistType); |
| 1486 } | 1488 } |
| 1487 } | 1489 } |
| 1488 | 1490 |
| 1489 template <CSSPropertyPriority priority> | 1491 template <CSSPropertyPriority priority, |
| 1492 StyleResolver::ShouldUpdateNeedsApplyPass shouldUpdateNeedsApplyPass> |
| 1490 void StyleResolver::applyProperties( | 1493 void StyleResolver::applyProperties( |
| 1491 StyleResolverState& state, | 1494 StyleResolverState& state, |
| 1492 const StylePropertySet* properties, | 1495 const StylePropertySet* properties, |
| 1493 bool isImportant, | 1496 bool isImportant, |
| 1494 bool inheritedOnly, | 1497 bool inheritedOnly, |
| 1495 NeedsApplyPass& needsApplyPass, | 1498 NeedsApplyPass& needsApplyPass, |
| 1496 PropertyWhitelistType propertyWhitelistType) { | 1499 PropertyWhitelistType propertyWhitelistType) { |
| 1497 unsigned propertyCount = properties->propertyCount(); | 1500 unsigned propertyCount = properties->propertyCount(); |
| 1498 for (unsigned i = 0; i < propertyCount; ++i) { | 1501 for (unsigned i = 0; i < propertyCount; ++i) { |
| 1499 StylePropertySet::PropertyReference current = properties->propertyAt(i); | 1502 StylePropertySet::PropertyReference current = properties->propertyAt(i); |
| 1500 CSSPropertyID property = current.id(); | 1503 CSSPropertyID property = current.id(); |
| 1501 | 1504 |
| 1502 if (property == CSSPropertyApplyAtRule) { | 1505 if (property == CSSPropertyApplyAtRule) { |
| 1503 DCHECK(!inheritedOnly); | 1506 DCHECK(!inheritedOnly); |
| 1504 applyPropertiesForApplyAtRule<priority>(state, current.value(), | 1507 applyPropertiesForApplyAtRule<priority, shouldUpdateNeedsApplyPass>( |
| 1505 isImportant, needsApplyPass, | 1508 state, current.value(), isImportant, needsApplyPass, |
| 1506 propertyWhitelistType); | 1509 propertyWhitelistType); |
| 1507 continue; | 1510 continue; |
| 1508 } | 1511 } |
| 1509 | 1512 |
| 1510 if (property == CSSPropertyAll && isImportant == current.isImportant()) { | 1513 if (property == CSSPropertyAll && isImportant == current.isImportant()) { |
| 1511 if (needsApplyPass.needsUpdate()) { | 1514 if (shouldUpdateNeedsApplyPass) { |
| 1512 needsApplyPass.set(HighPropertyPriority, isImportant); | 1515 needsApplyPass.set(HighPropertyPriority, isImportant); |
| 1513 needsApplyPass.set(LowPropertyPriority, isImportant); | 1516 needsApplyPass.set(LowPropertyPriority, isImportant); |
| 1514 } | 1517 } |
| 1515 applyAllProperty<priority>(state, current.value(), inheritedOnly, | 1518 applyAllProperty<priority>(state, current.value(), inheritedOnly, |
| 1516 propertyWhitelistType); | 1519 propertyWhitelistType); |
| 1517 continue; | 1520 continue; |
| 1518 } | 1521 } |
| 1519 | 1522 |
| 1520 if (needsApplyPass.needsUpdate()) | 1523 if (shouldUpdateNeedsApplyPass) |
| 1521 needsApplyPass.set(priorityForProperty(property), current.isImportant()); | 1524 needsApplyPass.set(priorityForProperty(property), current.isImportant()); |
| 1522 | 1525 |
| 1523 if (isImportant != current.isImportant()) | 1526 if (isImportant != current.isImportant()) |
| 1524 continue; | 1527 continue; |
| 1525 | 1528 |
| 1526 if (!isPropertyInWhitelist(propertyWhitelistType, property, document())) | 1529 if (!isPropertyInWhitelist(propertyWhitelistType, property, document())) |
| 1527 continue; | 1530 continue; |
| 1528 | 1531 |
| 1529 if (inheritedOnly && !current.isInherited()) { | 1532 if (inheritedOnly && !current.isInherited()) { |
| 1530 // If the property value is explicitly inherited, we need to apply further | 1533 // If the property value is explicitly inherited, we need to apply further |
| 1531 // non-inherited properties as they might override the value inherited | 1534 // non-inherited properties as they might override the value inherited |
| 1532 // here. For this reason we don't allow declarations with explicitly | 1535 // here. For this reason we don't allow declarations with explicitly |
| 1533 // inherited properties to be cached. | 1536 // inherited properties to be cached. |
| 1534 DCHECK(!current.value().isInheritedValue()); | 1537 DCHECK(!current.value().isInheritedValue()); |
| 1535 continue; | 1538 continue; |
| 1536 } | 1539 } |
| 1537 | 1540 |
| 1538 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) | 1541 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) |
| 1539 continue; | 1542 continue; |
| 1540 | 1543 |
| 1541 StyleBuilder::applyProperty(current.id(), state, current.value()); | 1544 StyleBuilder::applyProperty(current.id(), state, current.value()); |
| 1542 } | 1545 } |
| 1543 } | 1546 } |
| 1544 | 1547 |
| 1545 template <CSSPropertyPriority priority> | 1548 template <CSSPropertyPriority priority, |
| 1549 StyleResolver::ShouldUpdateNeedsApplyPass shouldUpdateNeedsApplyPass> |
| 1546 void StyleResolver::applyMatchedProperties(StyleResolverState& state, | 1550 void StyleResolver::applyMatchedProperties(StyleResolverState& state, |
| 1547 const MatchedPropertiesRange& range, | 1551 const MatchedPropertiesRange& range, |
| 1548 bool isImportant, | 1552 bool isImportant, |
| 1549 bool inheritedOnly, | 1553 bool inheritedOnly, |
| 1550 NeedsApplyPass& needsApplyPass) { | 1554 NeedsApplyPass& needsApplyPass) { |
| 1551 if (range.isEmpty()) | 1555 if (range.isEmpty()) |
| 1552 return; | 1556 return; |
| 1553 | 1557 |
| 1554 if (!needsApplyPass.needsUpdate() && | 1558 if (!shouldUpdateNeedsApplyPass && !needsApplyPass.get(priority, isImportant)) |
| 1555 !needsApplyPass.get(priority, isImportant)) | |
| 1556 return; | 1559 return; |
| 1557 | 1560 |
| 1558 if (state.style()->insideLink() != NotInsideLink) { | 1561 if (state.style()->insideLink() != NotInsideLink) { |
| 1559 for (const auto& matchedProperties : range) { | 1562 for (const auto& matchedProperties : range) { |
| 1560 unsigned linkMatchType = matchedProperties.m_types.linkMatchType; | 1563 unsigned linkMatchType = matchedProperties.m_types.linkMatchType; |
| 1561 // FIXME: It would be nicer to pass these as arguments but that requires | 1564 // FIXME: It would be nicer to pass these as arguments but that requires |
| 1562 // changes in many places. | 1565 // changes in many places. |
| 1563 state.setApplyPropertyToRegularStyle(linkMatchType & | 1566 state.setApplyPropertyToRegularStyle(linkMatchType & |
| 1564 CSSSelector::MatchLink); | 1567 CSSSelector::MatchLink); |
| 1565 state.setApplyPropertyToVisitedLinkStyle(linkMatchType & | 1568 state.setApplyPropertyToVisitedLinkStyle(linkMatchType & |
| 1566 CSSSelector::MatchVisited); | 1569 CSSSelector::MatchVisited); |
| 1567 | 1570 |
| 1568 applyProperties<priority>(state, matchedProperties.properties.get(), | 1571 applyProperties<priority, shouldUpdateNeedsApplyPass>( |
| 1569 isImportant, inheritedOnly, needsApplyPass, | 1572 state, matchedProperties.properties.get(), isImportant, inheritedOnly, |
| 1570 static_cast<PropertyWhitelistType>( | 1573 needsApplyPass, static_cast<PropertyWhitelistType>( |
| 1571 matchedProperties.m_types.whitelistType)); | 1574 matchedProperties.m_types.whitelistType)); |
| 1572 } | 1575 } |
| 1573 state.setApplyPropertyToRegularStyle(true); | 1576 state.setApplyPropertyToRegularStyle(true); |
| 1574 state.setApplyPropertyToVisitedLinkStyle(false); | 1577 state.setApplyPropertyToVisitedLinkStyle(false); |
| 1575 return; | 1578 return; |
| 1576 } | 1579 } |
| 1577 for (const auto& matchedProperties : range) { | 1580 for (const auto& matchedProperties : range) { |
| 1578 applyProperties<priority>(state, matchedProperties.properties.get(), | 1581 applyProperties<priority, shouldUpdateNeedsApplyPass>( |
| 1579 isImportant, inheritedOnly, needsApplyPass, | 1582 state, matchedProperties.properties.get(), isImportant, inheritedOnly, |
| 1580 static_cast<PropertyWhitelistType>( | 1583 needsApplyPass, static_cast<PropertyWhitelistType>( |
| 1581 matchedProperties.m_types.whitelistType)); | 1584 matchedProperties.m_types.whitelistType)); |
| 1582 } | 1585 } |
| 1583 } | 1586 } |
| 1584 | 1587 |
| 1585 static unsigned computeMatchedPropertiesHash( | 1588 static unsigned computeMatchedPropertiesHash( |
| 1586 const MatchedProperties* properties, | 1589 const MatchedProperties* properties, |
| 1587 unsigned size) { | 1590 unsigned size) { |
| 1588 return StringHasher::hashMemory(properties, sizeof(MatchedProperties) * size); | 1591 return StringHasher::hashMemory(properties, sizeof(MatchedProperties) * size); |
| 1589 } | 1592 } |
| 1590 | 1593 |
| 1591 void StyleResolver::invalidateMatchedPropertiesCache() { | 1594 void StyleResolver::invalidateMatchedPropertiesCache() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 | 1652 |
| 1650 return; | 1653 return; |
| 1651 } | 1654 } |
| 1652 applyInheritedOnly = true; | 1655 applyInheritedOnly = true; |
| 1653 } | 1656 } |
| 1654 | 1657 |
| 1655 NeedsApplyPass needsApplyPass; | 1658 NeedsApplyPass needsApplyPass; |
| 1656 | 1659 |
| 1657 // TODO(leviw): We need the proper bit for tracking whether we need to do this | 1660 // TODO(leviw): We need the proper bit for tracking whether we need to do this |
| 1658 // work. | 1661 // work. |
| 1659 applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), | 1662 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>( |
| 1660 false, applyInheritedOnly, | 1663 state, matchResult.authorRules(), false, applyInheritedOnly, |
| 1661 needsApplyPass); | 1664 needsApplyPass); |
| 1662 applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), | 1665 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>( |
| 1663 true, applyInheritedOnly, | 1666 state, matchResult.authorRules(), true, applyInheritedOnly, |
| 1664 needsApplyPass); | 1667 needsApplyPass); |
| 1665 // TODO(leviw): stop recalculating every time | 1668 // TODO(leviw): stop recalculating every time |
| 1666 CSSVariableResolver::resolveVariableDefinitions(state); | 1669 CSSVariableResolver::resolveVariableDefinitions(state); |
| 1667 | 1670 |
| 1668 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { | 1671 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { |
| 1669 if (cacheCustomPropertiesForApplyAtRules(state, | 1672 if (cacheCustomPropertiesForApplyAtRules(state, |
| 1670 matchResult.authorRules())) { | 1673 matchResult.authorRules())) { |
| 1671 needsApplyPass.setNeedsUpdate(true); | 1674 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>( |
| 1672 applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), | 1675 state, matchResult.authorRules(), false, applyInheritedOnly, |
| 1673 false, applyInheritedOnly, | 1676 needsApplyPass); |
| 1674 needsApplyPass); | 1677 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>( |
| 1675 applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), | 1678 state, matchResult.authorRules(), true, applyInheritedOnly, |
| 1676 true, applyInheritedOnly, | 1679 needsApplyPass); |
| 1677 needsApplyPass); | |
| 1678 CSSVariableResolver::resolveVariableDefinitions(state); | 1680 CSSVariableResolver::resolveVariableDefinitions(state); |
| 1679 } | 1681 } |
| 1680 } | 1682 } |
| 1681 | 1683 |
| 1682 // Now we have all of the matched rules in the appropriate order. Walk the | 1684 // Now we have all of the matched rules in the appropriate order. Walk the |
| 1683 // rules and apply high-priority properties first, i.e., those properties that | 1685 // rules and apply high-priority properties first, i.e., those properties that |
| 1684 // other properties depend on. The order is (1) high-priority not important, | 1686 // other properties depend on. The order is (1) high-priority not important, |
| 1685 // (2) high-priority important, (3) normal not important and (4) normal | 1687 // (2) high-priority important, (3) normal not important and (4) normal |
| 1686 // important. | 1688 // important. |
| 1687 needsApplyPass.setNeedsUpdate(true); | 1689 applyMatchedProperties<HighPropertyPriority, UpdateNeedsApplyPass>( |
| 1688 applyMatchedProperties<HighPropertyPriority>( | |
| 1689 state, matchResult.allRules(), false, applyInheritedOnly, needsApplyPass); | 1690 state, matchResult.allRules(), false, applyInheritedOnly, needsApplyPass); |
| 1690 for (auto range : ImportantAuthorRanges(matchResult)) { | 1691 for (auto range : ImportantAuthorRanges(matchResult)) { |
| 1691 applyMatchedProperties<HighPropertyPriority>( | 1692 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>( |
| 1692 state, range, true, applyInheritedOnly, needsApplyPass); | 1693 state, range, true, applyInheritedOnly, needsApplyPass); |
| 1693 } | 1694 } |
| 1694 applyMatchedProperties<HighPropertyPriority>( | 1695 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>( |
| 1695 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass); | 1696 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass); |
| 1696 | 1697 |
| 1697 if (UNLIKELY(isSVGForeignObjectElement(element))) { | 1698 if (UNLIKELY(isSVGForeignObjectElement(element))) { |
| 1698 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignObject | 1699 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignObject |
| 1699 // content should not be scaled again. | 1700 // content should not be scaled again. |
| 1700 // | 1701 // |
| 1701 // FIXME: The following hijacks the zoom property for foreignObject so that | 1702 // FIXME: The following hijacks the zoom property for foreignObject so that |
| 1702 // children of foreignObject get the correct font-size in case of zooming. | 1703 // children of foreignObject get the correct font-size in case of zooming. |
| 1703 // 'zoom' has HighPropertyPriority, along with other font-related properties | 1704 // 'zoom' has HighPropertyPriority, along with other font-related properties |
| 1704 // used as input to the FontBuilder, so resetting it here may cause the | 1705 // used as input to the FontBuilder, so resetting it here may cause the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1722 // properties. | 1723 // properties. |
| 1723 if (cachedMatchedProperties && | 1724 if (cachedMatchedProperties && |
| 1724 cachedMatchedProperties->computedStyle->getFontDescription() != | 1725 cachedMatchedProperties->computedStyle->getFontDescription() != |
| 1725 state.style()->getFontDescription()) | 1726 state.style()->getFontDescription()) |
| 1726 applyInheritedOnly = false; | 1727 applyInheritedOnly = false; |
| 1727 | 1728 |
| 1728 // Registered custom properties are computed after high priority properties. | 1729 // Registered custom properties are computed after high priority properties. |
| 1729 CSSVariableResolver::computeRegisteredVariables(state); | 1730 CSSVariableResolver::computeRegisteredVariables(state); |
| 1730 | 1731 |
| 1731 // Now do the normal priority UA properties. | 1732 // Now do the normal priority UA properties. |
| 1732 applyMatchedProperties<LowPropertyPriority>( | 1733 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( |
| 1733 state, matchResult.uaRules(), false, applyInheritedOnly, needsApplyPass); | 1734 state, matchResult.uaRules(), false, applyInheritedOnly, needsApplyPass); |
| 1734 | 1735 |
| 1735 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyle. | 1736 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyle. |
| 1736 state.cacheUserAgentBorderAndBackground(); | 1737 state.cacheUserAgentBorderAndBackground(); |
| 1737 | 1738 |
| 1738 // Now do the author and user normal priority properties and all the | 1739 // Now do the author and user normal priority properties and all the |
| 1739 // !important properties. | 1740 // !important properties. |
| 1740 applyMatchedProperties<LowPropertyPriority>(state, matchResult.authorRules(), | 1741 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( |
| 1741 false, applyInheritedOnly, | 1742 state, matchResult.authorRules(), false, applyInheritedOnly, |
| 1742 needsApplyPass); | 1743 needsApplyPass); |
| 1743 for (auto range : ImportantAuthorRanges(matchResult)) { | 1744 for (auto range : ImportantAuthorRanges(matchResult)) { |
| 1744 applyMatchedProperties<LowPropertyPriority>( | 1745 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( |
| 1745 state, range, true, applyInheritedOnly, needsApplyPass); | 1746 state, range, true, applyInheritedOnly, needsApplyPass); |
| 1746 } | 1747 } |
| 1747 applyMatchedProperties<LowPropertyPriority>( | 1748 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( |
| 1748 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass); | 1749 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass); |
| 1749 | 1750 |
| 1750 if (state.style()->hasAppearance() && !applyInheritedOnly) { | 1751 if (state.style()->hasAppearance() && !applyInheritedOnly) { |
| 1751 // Check whether the final border and background differs from the cached UA | 1752 // Check whether the final border and background differs from the cached UA |
| 1752 // ones. When there is a partial match in the MatchedPropertiesCache, these | 1753 // ones. When there is a partial match in the MatchedPropertiesCache, these |
| 1753 // flags will already be set correctly and the value stored in | 1754 // flags will already be set correctly and the value stored in |
| 1754 // cacheUserAgentBorderAndBackground is incorrect, so doing this check again | 1755 // cacheUserAgentBorderAndBackground is incorrect, so doing this check again |
| 1755 // would give the wrong answer. | 1756 // would give the wrong answer. |
| 1756 state.style()->setHasAuthorBackground(hasAuthorBackground(state)); | 1757 state.style()->setHasAuthorBackground(hasAuthorBackground(state)); |
| 1757 state.style()->setHasAuthorBorder(hasAuthorBorder(state)); | 1758 state.style()->setHasAuthorBorder(hasAuthorBorder(state)); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 visitor->trace(m_viewportDependentMediaQueryResults); | 1876 visitor->trace(m_viewportDependentMediaQueryResults); |
| 1876 visitor->trace(m_deviceDependentMediaQueryResults); | 1877 visitor->trace(m_deviceDependentMediaQueryResults); |
| 1877 visitor->trace(m_selectorFilter); | 1878 visitor->trace(m_selectorFilter); |
| 1878 visitor->trace(m_styleSharingLists); | 1879 visitor->trace(m_styleSharingLists); |
| 1879 visitor->trace(m_pendingStyleSheets); | 1880 visitor->trace(m_pendingStyleSheets); |
| 1880 visitor->trace(m_document); | 1881 visitor->trace(m_document); |
| 1881 visitor->trace(m_tracker); | 1882 visitor->trace(m_tracker); |
| 1882 } | 1883 } |
| 1883 | 1884 |
| 1884 } // namespace blink | 1885 } // namespace blink |
| OLD | NEW |