| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state
, CSSValue* value) | 155 void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state
, CSSValue* value) |
| 156 { | 156 { |
| 157 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 157 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 158 // As per the spec, 'color: currentColor' is treated as 'color: inherit' | 158 // As per the spec, 'color: currentColor' is treated as 'color: inherit' |
| 159 if (primitiveValue->getValueID() == CSSValueCurrentcolor) { | 159 if (primitiveValue->getValueID() == CSSValueCurrentcolor) { |
| 160 applyInheritCSSPropertyColor(state); | 160 applyInheritCSSPropertyColor(state); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 if (state.applyPropertyToRegularStyle()) | 164 if (state.applyPropertyToRegularStyle()) |
| 165 state.style()->setColor(StyleBuilderConverter::convertColor(state, value
)); | 165 state.style()->setColor(StyleBuilderConverter::convertColor(state, *valu
e)); |
| 166 if (state.applyPropertyToVisitedLinkStyle()) | 166 if (state.applyPropertyToVisitedLinkStyle()) |
| 167 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s
tate, value, true)); | 167 state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(s
tate, *value, true)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st
ate) | 170 void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& st
ate) |
| 171 { | 171 { |
| 172 state.style()->clearCursorList(); | 172 state.style()->clearCursorList(); |
| 173 state.style()->setCursor(ComputedStyle::initialCursor()); | 173 state.style()->setCursor(ComputedStyle::initialCursor()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st
ate) | 176 void StyleBuilderFunctions::applyInheritCSSPropertyCursor(StyleResolverState& st
ate) |
| 177 { | 177 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 205 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) | 205 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) |
| 206 { | 206 { |
| 207 state.style()->setDirection(*toCSSPrimitiveValue(value)); | 207 state.style()->setDirection(*toCSSPrimitiveValue(value)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR
esolverState& state, CSSValue* value) | 210 void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleR
esolverState& state, CSSValue* value) |
| 211 { | 211 { |
| 212 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
CSSValueAuto) | 212 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
CSSValueAuto) |
| 213 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO); | 213 state.style()->accessSVGStyle().setGlyphOrientationVertical(GO_AUTO); |
| 214 else | 214 else |
| 215 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder
Converter::convertGlyphOrientation(state, value)); | 215 state.style()->accessSVGStyle().setGlyphOrientationVertical(StyleBuilder
Converter::convertGlyphOrientation(state, *value)); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv
erState& state) | 218 void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolv
erState& state) |
| 219 { | 219 { |
| 220 state.style()->setNamedGridArea(ComputedStyle::initialNamedGridArea()); | 220 state.style()->setNamedGridArea(ComputedStyle::initialNamedGridArea()); |
| 221 state.style()->setNamedGridAreaRowCount(ComputedStyle::initialNamedGridAreaC
ount()); | 221 state.style()->setNamedGridAreaRowCount(ComputedStyle::initialNamedGridAreaC
ount()); |
| 222 state.style()->setNamedGridAreaColumnCount(ComputedStyle::initialNamedGridAr
eaCount()); | 222 state.style()->setNamedGridAreaColumnCount(ComputedStyle::initialNamedGridAr
eaCount()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void StyleBuilderFunctions::applyInheritCSSPropertyGridTemplateAreas(StyleResolv
erState& state) | 225 void StyleBuilderFunctions::applyInheritCSSPropertyGridTemplateAreas(StyleResolv
erState& state) |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 if (baselineShift == BS_LENGTH) | 832 if (baselineShift == BS_LENGTH) |
| 833 svgStyle.setBaselineShiftValue(parentSvgStyle.baselineShiftValue()); | 833 svgStyle.setBaselineShiftValue(parentSvgStyle.baselineShiftValue()); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(StyleResolverStat
e& state, CSSValue* value) | 836 void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(StyleResolverStat
e& state, CSSValue* value) |
| 837 { | 837 { |
| 838 SVGComputedStyle& svgStyle = state.style()->accessSVGStyle(); | 838 SVGComputedStyle& svgStyle = state.style()->accessSVGStyle(); |
| 839 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 839 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 840 if (!primitiveValue->isValueID()) { | 840 if (!primitiveValue->isValueID()) { |
| 841 svgStyle.setBaselineShift(BS_LENGTH); | 841 svgStyle.setBaselineShift(BS_LENGTH); |
| 842 svgStyle.setBaselineShiftValue(StyleBuilderConverter::convertLength(stat
e, primitiveValue)); | 842 svgStyle.setBaselineShiftValue(StyleBuilderConverter::convertLength(stat
e, *primitiveValue)); |
| 843 return; | 843 return; |
| 844 } | 844 } |
| 845 switch (primitiveValue->getValueID()) { | 845 switch (primitiveValue->getValueID()) { |
| 846 case CSSValueBaseline: | 846 case CSSValueBaseline: |
| 847 svgStyle.setBaselineShift(BS_LENGTH); | 847 svgStyle.setBaselineShift(BS_LENGTH); |
| 848 svgStyle.setBaselineShiftValue(Length(Fixed)); | 848 svgStyle.setBaselineShiftValue(Length(Fixed)); |
| 849 return; | 849 return; |
| 850 case CSSValueSub: | 850 case CSSValueSub: |
| 851 svgStyle.setBaselineShift(BS_SUB); | 851 svgStyle.setBaselineShift(BS_SUB); |
| 852 return; | 852 return; |
| 853 case CSSValueSuper: | 853 case CSSValueSuper: |
| 854 svgStyle.setBaselineShift(BS_SUPER); | 854 svgStyle.setBaselineShift(BS_SUPER); |
| 855 return; | 855 return; |
| 856 default: | 856 default: |
| 857 ASSERT_NOT_REACHED(); | 857 ASSERT_NOT_REACHED(); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 | 860 |
| 861 } // namespace blink | 861 } // namespace blink |
| OLD | NEW |