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

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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value) 165 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value)
166 { 166 {
167 // As per the spec, 'color: currentColor' is treated as 'color: inherit' 167 // As per the spec, 'color: currentColor' is treated as 'color: inherit'
168 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) { 168 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) {
169 applyInheritCSSPropertyColor(state); 169 applyInheritCSSPropertyColor(state);
170 return; 170 return;
171 } 171 }
172 172
173 bool isFillCurrentColorByParent = state.parentStyle()->svgStyle().isFillColo rCurrentColor();
174 bool isStrokeCurrentColorByParent = state.parentStyle()->svgStyle().isStroke ColorCurrentColor();
175
176 if (value->isPrimitiveValue() && (isFillCurrentColorByParent || isStrokeCurr entColorByParent)) {
fs 2015/12/15 11:36:24 I still don't think that this is something that yo
177 applyInheritCSSPropertyColor(state);
178 return;
179 }
180
173 if (state.applyPropertyToRegularStyle()) 181 if (state.applyPropertyToRegularStyle())
174 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e)); 182 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e));
175 if (state.applyPropertyToVisitedLinkStyle()) 183 if (state.applyPropertyToVisitedLinkStyle())
176 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true)); 184 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true));
177 } 185 }
178 186
179 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate) 187 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
180 { 188 {
181 state.style()->clearCursorList(); 189 state.style()->clearCursorList();
182 state.style()->setCursor(ComputedStyle::initialCursor()); 190 state.style()->setCursor(ComputedStyle::initialCursor());
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 return; 871 return;
864 case CSSValueSuper: 872 case CSSValueSuper:
865 svgStyle.setBaselineShift(BS_SUPER); 873 svgStyle.setBaselineShift(BS_SUPER);
866 return; 874 return;
867 default: 875 default:
868 ASSERT_NOT_REACHED(); 876 ASSERT_NOT_REACHED();
869 } 877 }
870 } 878 }
871 879
872 } // namespace blink 880 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698