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

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

Issue 2317903003: Add CSS property priority for CSS animation affecting properties (Closed)
Patch Set: Rebase onto latest optimisation Created 4 years, 1 month 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/CSSPropertyPriority.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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, UpdateNeedsApplyPass>( 1024 applyMatchedProperties<AnimationPropertyPriority, UpdateNeedsApplyPass>(
1025 state, result.allRules(), false, inheritedOnly, needsApplyPass);
1026 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>(
1025 state, result.allRules(), false, inheritedOnly, needsApplyPass); 1027 state, result.allRules(), false, inheritedOnly, needsApplyPass);
1026 1028
1027 // If our font got dirtied, go ahead and update it now. 1029 // If our font got dirtied, go ahead and update it now.
1028 updateFont(state); 1030 updateFont(state);
1029 1031
1030 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>( 1032 applyMatchedProperties<LowPropertyPriority, CheckNeedsApplyPass>(
1031 state, result.allRules(), false, inheritedOnly, needsApplyPass); 1033 state, result.allRules(), false, inheritedOnly, needsApplyPass);
1032 1034
1033 loadPendingResources(state); 1035 loadPendingResources(state);
1034 1036
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 if (property == CSSPropertyApplyAtRule) { 1507 if (property == CSSPropertyApplyAtRule) {
1506 DCHECK(!inheritedOnly); 1508 DCHECK(!inheritedOnly);
1507 applyPropertiesForApplyAtRule<priority, shouldUpdateNeedsApplyPass>( 1509 applyPropertiesForApplyAtRule<priority, shouldUpdateNeedsApplyPass>(
1508 state, current.value(), isImportant, needsApplyPass, 1510 state, current.value(), isImportant, needsApplyPass,
1509 propertyWhitelistType); 1511 propertyWhitelistType);
1510 continue; 1512 continue;
1511 } 1513 }
1512 1514
1513 if (property == CSSPropertyAll && isImportant == current.isImportant()) { 1515 if (property == CSSPropertyAll && isImportant == current.isImportant()) {
1514 if (shouldUpdateNeedsApplyPass) { 1516 if (shouldUpdateNeedsApplyPass) {
1517 needsApplyPass.set(AnimationPropertyPriority, isImportant);
1515 needsApplyPass.set(HighPropertyPriority, isImportant); 1518 needsApplyPass.set(HighPropertyPriority, isImportant);
1516 needsApplyPass.set(LowPropertyPriority, isImportant); 1519 needsApplyPass.set(LowPropertyPriority, isImportant);
1517 } 1520 }
1518 applyAllProperty<priority>(state, current.value(), inheritedOnly, 1521 applyAllProperty<priority>(state, current.value(), inheritedOnly,
1519 propertyWhitelistType); 1522 propertyWhitelistType);
1520 continue; 1523 continue;
1521 } 1524 }
1522 1525
1523 if (shouldUpdateNeedsApplyPass) 1526 if (shouldUpdateNeedsApplyPass)
1524 needsApplyPass.set(priorityForProperty(property), current.isImportant()); 1527 needsApplyPass.set(priorityForProperty(property), current.isImportant());
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>( 1676 applyMatchedProperties<ResolveVariables, UpdateNeedsApplyPass>(
1674 state, matchResult.authorRules(), false, applyInheritedOnly, 1677 state, matchResult.authorRules(), false, applyInheritedOnly,
1675 needsApplyPass); 1678 needsApplyPass);
1676 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>( 1679 applyMatchedProperties<ResolveVariables, CheckNeedsApplyPass>(
1677 state, matchResult.authorRules(), true, applyInheritedOnly, 1680 state, matchResult.authorRules(), true, applyInheritedOnly,
1678 needsApplyPass); 1681 needsApplyPass);
1679 CSSVariableResolver::resolveVariableDefinitions(state); 1682 CSSVariableResolver::resolveVariableDefinitions(state);
1680 } 1683 }
1681 } 1684 }
1682 1685
1686 // Apply animation affecting properties.
1687 applyMatchedProperties<AnimationPropertyPriority, UpdateNeedsApplyPass>(
1688 state, matchResult.allRules(), false, applyInheritedOnly, needsApplyPass);
1689 applyMatchedProperties<AnimationPropertyPriority, CheckNeedsApplyPass>(
1690 state, matchResult.allRules(), true, applyInheritedOnly, needsApplyPass);
1691
1683 // Now we have all of the matched rules in the appropriate order. Walk the 1692 // Now we have all of the matched rules in the appropriate order. Walk the
1684 // rules and apply high-priority properties first, i.e., those properties that 1693 // rules and apply high-priority properties first, i.e., those properties that
1685 // other properties depend on. The order is (1) high-priority not important, 1694 // other properties depend on. The order is (1) high-priority not important,
1686 // (2) high-priority important, (3) normal not important and (4) normal 1695 // (2) high-priority important, (3) normal not important and (4) normal
1687 // important. 1696 // important.
1688 applyMatchedProperties<HighPropertyPriority, UpdateNeedsApplyPass>( 1697 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>(
1689 state, matchResult.allRules(), false, applyInheritedOnly, needsApplyPass); 1698 state, matchResult.allRules(), false, applyInheritedOnly, needsApplyPass);
1690 for (auto range : ImportantAuthorRanges(matchResult)) { 1699 for (auto range : ImportantAuthorRanges(matchResult)) {
1691 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>( 1700 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>(
1692 state, range, true, applyInheritedOnly, needsApplyPass); 1701 state, range, true, applyInheritedOnly, needsApplyPass);
1693 } 1702 }
1694 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>( 1703 applyMatchedProperties<HighPropertyPriority, CheckNeedsApplyPass>(
1695 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass); 1704 state, matchResult.uaRules(), true, applyInheritedOnly, needsApplyPass);
1696 1705
1697 if (UNLIKELY(isSVGForeignObjectElement(element))) { 1706 if (UNLIKELY(isSVGForeignObjectElement(element))) {
1698 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignObject 1707 // LayoutSVGRoot handles zooming for the whole SVG subtree, so foreignObject
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 visitor->trace(m_viewportDependentMediaQueryResults); 1883 visitor->trace(m_viewportDependentMediaQueryResults);
1875 visitor->trace(m_deviceDependentMediaQueryResults); 1884 visitor->trace(m_deviceDependentMediaQueryResults);
1876 visitor->trace(m_selectorFilter); 1885 visitor->trace(m_selectorFilter);
1877 visitor->trace(m_styleSharingLists); 1886 visitor->trace(m_styleSharingLists);
1878 visitor->trace(m_pendingStyleSheets); 1887 visitor->trace(m_pendingStyleSheets);
1879 visitor->trace(m_document); 1888 visitor->trace(m_document);
1880 visitor->trace(m_tracker); 1889 visitor->trace(m_tracker);
1881 } 1890 }
1882 1891
1883 } // namespace blink 1892 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698