| 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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 | 1567 |
| 1568 void StyleResolver::applyMatchedProperties(StyleResolverState& state, | 1568 void StyleResolver::applyMatchedProperties(StyleResolverState& state, |
| 1569 const MatchResult& matchResult) { | 1569 const MatchResult& matchResult) { |
| 1570 const Element* element = state.element(); | 1570 const Element* element = state.element(); |
| 1571 DCHECK(element); | 1571 DCHECK(element); |
| 1572 | 1572 |
| 1573 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), matchedPropertyApply, | 1573 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), matchedPropertyApply, |
| 1574 1); | 1574 1); |
| 1575 | 1575 |
| 1576 unsigned cacheHash = | 1576 unsigned cacheHash = |
| 1577 RuntimeEnabledFeatures::styleMatchedPropertiesCacheEnabled() && | 1577 matchResult.isCacheable() |
| 1578 matchResult.isCacheable() | |
| 1579 ? computeMatchedPropertiesHash(matchResult.matchedProperties().data(), | 1578 ? computeMatchedPropertiesHash(matchResult.matchedProperties().data(), |
| 1580 matchResult.matchedProperties().size()) | 1579 matchResult.matchedProperties().size()) |
| 1581 : 0; | 1580 : 0; |
| 1582 bool applyInheritedOnly = false; | 1581 bool applyInheritedOnly = false; |
| 1583 const CachedMatchedProperties* cachedMatchedProperties = | 1582 const CachedMatchedProperties* cachedMatchedProperties = |
| 1584 cacheHash | 1583 cacheHash |
| 1585 ? m_matchedPropertiesCache.find(cacheHash, state, | 1584 ? m_matchedPropertiesCache.find(cacheHash, state, |
| 1586 matchResult.matchedProperties()) | 1585 matchResult.matchedProperties()) |
| 1587 : nullptr; | 1586 : nullptr; |
| 1588 | 1587 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 // cacheUserAgentBorderAndBackground is incorrect, so doing this check again | 1711 // cacheUserAgentBorderAndBackground is incorrect, so doing this check again |
| 1713 // would give the wrong answer. | 1712 // would give the wrong answer. |
| 1714 state.style()->setHasAuthorBackground(hasAuthorBackground(state)); | 1713 state.style()->setHasAuthorBackground(hasAuthorBackground(state)); |
| 1715 state.style()->setHasAuthorBorder(hasAuthorBorder(state)); | 1714 state.style()->setHasAuthorBorder(hasAuthorBorder(state)); |
| 1716 } | 1715 } |
| 1717 | 1716 |
| 1718 loadPendingResources(state); | 1717 loadPendingResources(state); |
| 1719 | 1718 |
| 1720 if (!cachedMatchedProperties && cacheHash && | 1719 if (!cachedMatchedProperties && cacheHash && |
| 1721 MatchedPropertiesCache::isCacheable(state)) { | 1720 MatchedPropertiesCache::isCacheable(state)) { |
| 1722 DCHECK(RuntimeEnabledFeatures::styleMatchedPropertiesCacheEnabled()); | |
| 1723 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), | 1721 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), |
| 1724 matchedPropertyCacheAdded, 1); | 1722 matchedPropertyCacheAdded, 1); |
| 1725 m_matchedPropertiesCache.add(*state.style(), *state.parentStyle(), | 1723 m_matchedPropertiesCache.add(*state.style(), *state.parentStyle(), |
| 1726 cacheHash, matchResult.matchedProperties()); | 1724 cacheHash, matchResult.matchedProperties()); |
| 1727 } | 1725 } |
| 1728 | 1726 |
| 1729 DCHECK(!state.fontBuilder().fontDirty()); | 1727 DCHECK(!state.fontBuilder().fontDirty()); |
| 1730 } | 1728 } |
| 1731 | 1729 |
| 1732 bool StyleResolver::hasAuthorBackground(const StyleResolverState& state) { | 1730 bool StyleResolver::hasAuthorBackground(const StyleResolverState& state) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 visitor->trace(m_medium); | 1827 visitor->trace(m_medium); |
| 1830 visitor->trace(m_viewportDependentMediaQueryResults); | 1828 visitor->trace(m_viewportDependentMediaQueryResults); |
| 1831 visitor->trace(m_deviceDependentMediaQueryResults); | 1829 visitor->trace(m_deviceDependentMediaQueryResults); |
| 1832 visitor->trace(m_selectorFilter); | 1830 visitor->trace(m_selectorFilter); |
| 1833 visitor->trace(m_styleSharingLists); | 1831 visitor->trace(m_styleSharingLists); |
| 1834 visitor->trace(m_pendingStyleSheets); | 1832 visitor->trace(m_pendingStyleSheets); |
| 1835 visitor->trace(m_document); | 1833 visitor->trace(m_document); |
| 1836 } | 1834 } |
| 1837 | 1835 |
| 1838 } // namespace blink | 1836 } // namespace blink |
| OLD | NEW |