Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2722983004: Use ApplyAnimations enum parameter instead of bool for callsite readability (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 m_wasViewportResized = false; 1599 m_wasViewportResized = false;
1600 } 1600 }
1601 1601
1602 void StyleResolver::applyMatchedPropertiesAndCustomPropertyAnimations( 1602 void StyleResolver::applyMatchedPropertiesAndCustomPropertyAnimations(
1603 StyleResolverState& state, 1603 StyleResolverState& state,
1604 const MatchResult& matchResult, 1604 const MatchResult& matchResult,
1605 const Element* animatingElement) { 1605 const Element* animatingElement) {
1606 CacheSuccess cacheSuccess = applyMatchedCache(state, matchResult); 1606 CacheSuccess cacheSuccess = applyMatchedCache(state, matchResult);
1607 NeedsApplyPass needsApplyPass; 1607 NeedsApplyPass needsApplyPass;
1608 if (!cacheSuccess.isFullCacheHit()) { 1608 if (!cacheSuccess.isFullCacheHit()) {
1609 applyCustomProperties(state, matchResult, false, cacheSuccess, 1609 applyCustomProperties(state, matchResult, ExcludeAnimations, cacheSuccess,
1610 needsApplyPass); 1610 needsApplyPass);
1611 applyMatchedAnimationProperties(state, matchResult, cacheSuccess, 1611 applyMatchedAnimationProperties(state, matchResult, cacheSuccess,
1612 needsApplyPass); 1612 needsApplyPass);
1613 } 1613 }
1614 if (state.style()->animations() || 1614 if (state.style()->animations() ||
1615 (animatingElement && animatingElement->hasAnimations())) { 1615 (animatingElement && animatingElement->hasAnimations())) {
1616 calculateAnimationUpdate(state, animatingElement); 1616 calculateAnimationUpdate(state, animatingElement);
1617 if (state.isAnimatingCustomProperties()) { 1617 if (state.isAnimatingCustomProperties()) {
1618 cacheSuccess.setFailed(); 1618 cacheSuccess.setFailed();
1619 applyCustomProperties(state, matchResult, true, cacheSuccess, 1619 applyCustomProperties(state, matchResult, IncludeAnimations, cacheSuccess,
1620 needsApplyPass); 1620 needsApplyPass);
1621 } 1621 }
1622 } 1622 }
1623 if (!cacheSuccess.isFullCacheHit()) { 1623 if (!cacheSuccess.isFullCacheHit()) {
1624 applyMatchedStandardProperties(state, matchResult, cacheSuccess, 1624 applyMatchedStandardProperties(state, matchResult, cacheSuccess,
1625 needsApplyPass); 1625 needsApplyPass);
1626 } 1626 }
1627 } 1627 }
1628 1628
1629 StyleResolver::CacheSuccess StyleResolver::applyMatchedCache( 1629 StyleResolver::CacheSuccess StyleResolver::applyMatchedCache(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 1679
1680 isNonInheritedCacheHit = true; 1680 isNonInheritedCacheHit = true;
1681 } 1681 }
1682 1682
1683 return CacheSuccess(isInheritedCacheHit, isNonInheritedCacheHit, cacheHash, 1683 return CacheSuccess(isInheritedCacheHit, isNonInheritedCacheHit, cacheHash,
1684 cachedMatchedProperties); 1684 cachedMatchedProperties);
1685 } 1685 }
1686 1686
1687 void StyleResolver::applyCustomProperties(StyleResolverState& state, 1687 void StyleResolver::applyCustomProperties(StyleResolverState& state,
1688 const MatchResult& matchResult, 1688 const MatchResult& matchResult,
1689 bool applyAnimations, 1689 ApplyAnimations applyAnimations,
1690 const CacheSuccess& cacheSuccess, 1690 const CacheSuccess& cacheSuccess,
1691 NeedsApplyPass& needsApplyPass) { 1691 NeedsApplyPass& needsApplyPass) {
1692 DCHECK(!cacheSuccess.isFullCacheHit()); 1692 DCHECK(!cacheSuccess.isFullCacheHit());
1693 bool applyInheritedOnly = cacheSuccess.shouldApplyInheritedOnly(); 1693 bool applyInheritedOnly = cacheSuccess.shouldApplyInheritedOnly();
1694 1694
1695 // TODO(leviw): We need the proper bit for tracking whether we need to do 1695 // TODO(leviw): We need the proper bit for tracking whether we need to do
1696 // this work. 1696 // this work.
1697 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>( 1697 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>(
1698 state, matchResult.authorRules(), false, applyInheritedOnly, 1698 state, matchResult.authorRules(), false, applyInheritedOnly,
1699 needsApplyPass); 1699 needsApplyPass);
1700 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>( 1700 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>(
1701 state, matchResult.authorRules(), true, applyInheritedOnly, 1701 state, matchResult.authorRules(), true, applyInheritedOnly,
1702 needsApplyPass); 1702 needsApplyPass);
1703 if (applyAnimations) { 1703 if (applyAnimations == IncludeAnimations) {
1704 applyAnimatedProperties<ResolveVariables>( 1704 applyAnimatedProperties<ResolveVariables>(
1705 state, state.animationUpdate().activeInterpolationsForAnimations()); 1705 state, state.animationUpdate().activeInterpolationsForAnimations());
1706 } 1706 }
1707 // TODO(leviw): stop recalculating every time 1707 // TODO(leviw): stop recalculating every time
1708 CSSVariableResolver::resolveVariableDefinitions(state); 1708 CSSVariableResolver::resolveVariableDefinitions(state);
1709 1709
1710 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { 1710 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) {
1711 if (cacheCustomPropertiesForApplyAtRules(state, 1711 if (cacheCustomPropertiesForApplyAtRules(state,
1712 matchResult.authorRules())) { 1712 matchResult.authorRules())) {
1713 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>( 1713 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>(
1714 state, matchResult.authorRules(), false, applyInheritedOnly, 1714 state, matchResult.authorRules(), false, applyInheritedOnly,
1715 needsApplyPass); 1715 needsApplyPass);
1716 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>( 1716 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>(
1717 state, matchResult.authorRules(), true, applyInheritedOnly, 1717 state, matchResult.authorRules(), true, applyInheritedOnly,
1718 needsApplyPass); 1718 needsApplyPass);
1719 if (applyAnimations) { 1719 if (applyAnimations == IncludeAnimations) {
1720 applyAnimatedProperties<ResolveVariables>( 1720 applyAnimatedProperties<ResolveVariables>(
1721 state, state.animationUpdate().activeInterpolationsForAnimations()); 1721 state, state.animationUpdate().activeInterpolationsForAnimations());
1722 } 1722 }
1723 CSSVariableResolver::resolveVariableDefinitions(state); 1723 CSSVariableResolver::resolveVariableDefinitions(state);
1724 } 1724 }
1725 } 1725 }
1726 } 1726 }
1727 1727
1728 void StyleResolver::applyMatchedAnimationProperties( 1728 void StyleResolver::applyMatchedAnimationProperties(
1729 StyleResolverState& state, 1729 StyleResolverState& state,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 1945
1946 DEFINE_TRACE(StyleResolver) { 1946 DEFINE_TRACE(StyleResolver) {
1947 visitor->trace(m_matchedPropertiesCache); 1947 visitor->trace(m_matchedPropertiesCache);
1948 visitor->trace(m_selectorFilter); 1948 visitor->trace(m_selectorFilter);
1949 visitor->trace(m_styleSharingLists); 1949 visitor->trace(m_styleSharingLists);
1950 visitor->trace(m_document); 1950 visitor->trace(m_document);
1951 visitor->trace(m_tracker); 1951 visitor->trace(m_tracker);
1952 } 1952 }
1953 1953
1954 } // namespace blink 1954 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698