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

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

Issue 1376573004: Split out Color from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_property
Patch Set: Rebase and review feedback Created 5 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
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 { 147 {
148 Color color = state.parentStyle()->color(); 148 Color color = state.parentStyle()->color();
149 if (state.applyPropertyToRegularStyle()) 149 if (state.applyPropertyToRegularStyle())
150 state.style()->setColor(color); 150 state.style()->setColor(color);
151 if (state.applyPropertyToVisitedLinkStyle()) 151 if (state.applyPropertyToVisitedLinkStyle())
152 state.style()->setVisitedLinkColor(color); 152 state.style()->setVisitedLinkColor(color);
153 } 153 }
154 154
155 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value) 155 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state , CSSValue* value)
156 { 156 {
157 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
158 // As per the spec, 'color: currentColor' is treated as 'color: inherit' 157 // As per the spec, 'color: currentColor' is treated as 'color: inherit'
159 if (primitiveValue->getValueID() == CSSValueCurrentcolor) { 158 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) {
160 applyInheritCSSPropertyColor(state); 159 applyInheritCSSPropertyColor(state);
161 return; 160 return;
162 } 161 }
163 162
164 if (state.applyPropertyToRegularStyle()) 163 if (state.applyPropertyToRegularStyle())
165 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e)); 164 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu e));
166 if (state.applyPropertyToVisitedLinkStyle()) 165 if (state.applyPropertyToVisitedLinkStyle())
167 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true)); 166 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s tate, *value, true));
168 } 167 }
169 168
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 return; 850 return;
852 case CSSValueSuper: 851 case CSSValueSuper:
853 svgStyle.setBaselineShift(BS_SUPER); 852 svgStyle.setBaselineShift(BS_SUPER);
854 return; 853 return;
855 default: 854 default:
856 ASSERT_NOT_REACHED(); 855 ASSERT_NOT_REACHED();
857 } 856 }
858 } 857 }
859 858
860 } // namespace blink 859 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698