Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |