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

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

Issue 1455153003: Fix animation of 'color' w/ currentColor for SVG 'fill' and 'stroke' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 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. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value) 163 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value)
164 { 164 {
165 // As per the spec, 'color: currentColor' is treated as 'color: inherit' 165 // As per the spec, 'color: currentColor' is treated as 'color: inherit'
166 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) { 166 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) {
167 applyInheritCSSPropertyColor(state); 167 applyInheritCSSPropertyColor(state);
168 return; 168 return;
169 } 169 }
170 170
171 if (state.applyPropertyToRegularStyle()) 171 bool isFillCurrentColor = state.style()->svgStyle().isFillColorCurrentColor( );
172 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e)); 172 bool isStrokeCurrentColor = state.style()->svgStyle().isStrokeColorCurrentCo lor();
173 if (state.applyPropertyToVisitedLinkStyle()) 173
174 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true)); 174 if (state.applyPropertyToRegularStyle()) {
175 if (!isFillCurrentColor && !isStrokeCurrentColor)
176 state.style()->setColor(StyleBuilderConverter::convertColor(state, * value));
177
178 if (isFillCurrentColor)
179 state.style()->setColor(state.style()->svgStyle().fillPaintColor());
fs 2015/11/27 08:50:25 You shouldn't be overriding the value of 'color' l
180 if (isStrokeCurrentColor)
181 state.style()->setColor(state.style()->svgStyle().strokePaintColor() );
182 }
183
184 if (state.applyPropertyToVisitedLinkStyle()) {
185 if (!isFillCurrentColor && !isStrokeCurrentColor)
186 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertCol or(state, *value, true));
187
188 if (isFillCurrentColor)
189 state.style()->setColor(state.style()->svgStyle().visitedLinkFillPai ntColor());
190 if (isStrokeCurrentColor)
191 state.style()->setColor(state.style()->svgStyle().visitedLinkStrokeP aintColor());
192 }
175 } 193 }
176 194
177 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate) 195 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
178 { 196 {
179 state.style()->clearCursorList(); 197 state.style()->clearCursorList();
180 state.style()->setCursor(ComputedStyle::initialCursor()); 198 state.style()->setCursor(ComputedStyle::initialCursor());
181 } 199 }
182 200
183 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate) 201 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st ate)
184 { 202 {
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 return; 880 return;
863 case CSSValueSuper: 881 case CSSValueSuper:
864 svgStyle.setBaselineShift(BS_SUPER); 882 svgStyle.setBaselineShift(BS_SUPER);
865 return; 883 return;
866 default: 884 default:
867 ASSERT_NOT_REACHED(); 885 ASSERT_NOT_REACHED();
868 } 886 }
869 } 887 }
870 888
871 } // namespace blink 889 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698