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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2426323003: Invalidate properties registered as non-inherited for custom paint (Closed)
Patch Set: Created 4 years, 2 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/style/ComputedStyle.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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 return true; 1011 return true;
1012 1012
1013 for (CSSPropertyID propertyID : *value->nativeInvalidationProperties()) { 1013 for (CSSPropertyID propertyID : *value->nativeInvalidationProperties()) {
1014 // TODO(ikilpatrick): remove isInterpolableProperty check once 1014 // TODO(ikilpatrick): remove isInterpolableProperty check once
1015 // CSSPropertyEquality::propertiesEqual correctly handles all properties. 1015 // CSSPropertyEquality::propertiesEqual correctly handles all properties.
1016 if (!CSSPropertyMetadata::isInterpolableProperty(propertyID) || 1016 if (!CSSPropertyMetadata::isInterpolableProperty(propertyID) ||
1017 !CSSPropertyEquality::propertiesEqual(propertyID, *this, other)) 1017 !CSSPropertyEquality::propertiesEqual(propertyID, *this, other))
1018 return true; 1018 return true;
1019 } 1019 }
1020 1020
1021 if (inheritedVariables() || other.inheritedVariables()) { 1021 if (inheritedVariables() || nonInheritedVariables() ||
1022 other.inheritedVariables() || other.nonInheritedVariables()) {
meade_UTC10 2016/10/19 07:41:14 There are variables that aren't inherited or non-i
Timothy Loh 2016/10/20 06:05:17 There's just no function right now that checks whe
1022 for (const AtomicString& property : 1023 for (const AtomicString& property :
1023 *value->customInvalidationProperties()) { 1024 *value->customInvalidationProperties()) {
1024 CSSVariableData* thisVar = 1025 if (!dataEquivalent(getVariable(property), other.getVariable(property)))
1025 inheritedVariables() ? inheritedVariables()->getVariable(property)
1026 : nullptr;
1027 CSSVariableData* otherVar =
1028 other.inheritedVariables()
1029 ? other.inheritedVariables()->getVariable(property)
1030 : nullptr;
1031
1032 if (!dataEquivalent(thisVar, otherVar))
1033 return true; 1026 return true;
1034 } 1027 }
1035 } 1028 }
1036 1029
1037 return false; 1030 return false;
1038 } 1031 }
1039 1032
1040 void ComputedStyle::updatePropertySpecificDifferences( 1033 void ComputedStyle::updatePropertySpecificDifferences(
1041 const ComputedStyle& other, 1034 const ComputedStyle& other,
1042 StyleDifference& diff) const { 1035 StyleDifference& diff) const {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 } 1766 }
1774 1767
1775 void ComputedStyle::removeInheritedVariable(const AtomicString& name) { 1768 void ComputedStyle::removeInheritedVariable(const AtomicString& name) {
1776 mutableInheritedVariables().removeVariable(name); 1769 mutableInheritedVariables().removeVariable(name);
1777 } 1770 }
1778 1771
1779 void ComputedStyle::removeNonInheritedVariable(const AtomicString& name) { 1772 void ComputedStyle::removeNonInheritedVariable(const AtomicString& name) {
1780 mutableNonInheritedVariables().removeVariable(name); 1773 mutableNonInheritedVariables().removeVariable(name);
1781 } 1774 }
1782 1775
1776 CSSVariableData* ComputedStyle::getVariable(const AtomicString& name) const {
1777 if (inheritedVariables()) {
1778 if (CSSVariableData* variable = inheritedVariables()->getVariable(name))
1779 return variable;
1780 }
1781 if (nonInheritedVariables()) {
1782 if (CSSVariableData* variable = nonInheritedVariables()->getVariable(name))
1783 return variable;
1784 }
1785 return nullptr;
1786 }
1787
1783 float ComputedStyle::wordSpacing() const { 1788 float ComputedStyle::wordSpacing() const {
1784 return getFontDescription().wordSpacing(); 1789 return getFontDescription().wordSpacing();
1785 } 1790 }
1786 float ComputedStyle::letterSpacing() const { 1791 float ComputedStyle::letterSpacing() const {
1787 return getFontDescription().letterSpacing(); 1792 return getFontDescription().letterSpacing();
1788 } 1793 }
1789 1794
1790 bool ComputedStyle::setFontDescription(const FontDescription& v) { 1795 bool ComputedStyle::setFontDescription(const FontDescription& v) {
1791 if (m_styleInheritedData->font.getFontDescription() != v) { 1796 if (m_styleInheritedData->font.getFontDescription() != v) {
1792 m_styleInheritedData.access()->font = Font(v); 1797 m_styleInheritedData.access()->font = Font(v);
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 if (value < 0) 2373 if (value < 0)
2369 fvalue -= 0.5f; 2374 fvalue -= 0.5f;
2370 else 2375 else
2371 fvalue += 0.5f; 2376 fvalue += 0.5f;
2372 } 2377 }
2373 2378
2374 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2379 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2375 } 2380 }
2376 2381
2377 } // namespace blink 2382 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698