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

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: Draft4 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 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 bool isFillCurrentColor = state.style()->svgStyle().isFillColorCurrentColor( );
172 bool isStrokeCurrentColor = state.style()->svgStyle().isStrokeColorCurrentCo lor();
173
174 if (isFillCurrentColor || isStrokeCurrentColor)
fs 2015/11/25 17:23:00 Why do you do this?
hyunjunekim2 2015/11/26 01:07:26 About the second case, the 'color="red"' was appli
fs 2015/11/26 11:30:34 I think I understand what you mean, but I think th
175 return;
176
171 if (state.applyPropertyToRegularStyle()) 177 if (state.applyPropertyToRegularStyle())
172 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e)); 178 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e));
173 if (state.applyPropertyToVisitedLinkStyle()) 179 if (state.applyPropertyToVisitedLinkStyle())
174 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true)); 180 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true));
175 } 181 }
176 182
177 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate) 183 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st ate)
178 { 184 {
179 state.style()->clearCursorList(); 185 state.style()->clearCursorList();
180 state.style()->setCursor(ComputedStyle::initialCursor()); 186 state.style()->setCursor(ComputedStyle::initialCursor());
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 return; 868 return;
863 case CSSValueSuper: 869 case CSSValueSuper:
864 svgStyle.setBaselineShift(BS_SUPER); 870 svgStyle.setBaselineShift(BS_SUPER);
865 return; 871 return;
866 default: 872 default:
867 ASSERT_NOT_REACHED(); 873 ASSERT_NOT_REACHED();
868 } 874 }
869 } 875 }
870 876
871 } // namespace blink 877 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698