OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
9 * distribution. | 9 * distribution. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 mask.setMaskDefaults(); | 84 mask.setMaskDefaults(); |
85 CSSToStyleMap::mapNinePieceImage(state, CSSPropertyWebkitBoxReflect, *re
flectValue->mask(), mask); | 85 CSSToStyleMap::mapNinePieceImage(state, CSSPropertyWebkitBoxReflect, *re
flectValue->mask(), mask); |
86 reflection->setMask(mask); | 86 reflection->setMask(mask); |
87 } | 87 } |
88 | 88 |
89 return reflection.release(); | 89 return reflection.release(); |
90 } | 90 } |
91 | 91 |
92 Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* v
alue, bool forVisitedLink) | 92 Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* v
alue, bool forVisitedLink) |
93 { | 93 { |
94 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 94 return state.document().textLinkColors().colorFromCSSValue(value, state.styl
e()->color(), forVisitedLink); |
95 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa
lue, state.style()->color(), forVisitedLink); | |
96 } | 95 } |
97 | 96 |
98 AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState
& state, CSSValue* value) | 97 AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState
& state, CSSValue* value) |
99 { | 98 { |
100 if (value->isURIValue()) | 99 if (value->isURIValue()) |
101 return SVGURIReference::fragmentIdentifierFromIRIString(toCSSURIValue(va
lue)->value(), state.element()->treeScope()); | 100 return SVGURIReference::fragmentIdentifierFromIRIString(toCSSURIValue(va
lue)->value(), state.element()->treeScope()); |
102 return nullAtom; | 101 return nullAtom; |
103 } | 102 } |
104 | 103 |
105 LengthBox StyleBuilderConverter::convertClip(StyleResolverState& state, CSSValue
* value) | 104 LengthBox StyleBuilderConverter::convertClip(StyleResolverState& state, CSSValue
* value) |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 size_t length = dashes->length(); | 844 size_t length = dashes->length(); |
846 for (size_t i = 0; i < length; ++i) { | 845 for (size_t i = 0; i < length; ++i) { |
847 array->append(convertLength(state, toCSSPrimitiveValue(dashes->item(i)))
); | 846 array->append(convertLength(state, toCSSPrimitiveValue(dashes->item(i)))
); |
848 } | 847 } |
849 | 848 |
850 return array.release(); | 849 return array.release(); |
851 } | 850 } |
852 | 851 |
853 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C
SSValue* value, bool forVisitedLink) | 852 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C
SSValue* value, bool forVisitedLink) |
854 { | 853 { |
855 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 854 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
CSSValueCurrentcolor) |
856 if (primitiveValue->getValueID() == CSSValueCurrentcolor) | |
857 return StyleColor::currentColor(); | 855 return StyleColor::currentColor(); |
858 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa
lue, Color(), forVisitedLink); | 856 return state.document().textLinkColors().colorFromCSSValue(value, Color(), f
orVisitedLink); |
859 } | 857 } |
860 | 858 |
861 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C
SSValue* value) | 859 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C
SSValue* value) |
862 { | 860 { |
863 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 861 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
864 if (primitiveValue->getValueID()) { | 862 if (primitiveValue->getValueID()) { |
865 float multiplier = convertLineWidth<float>(state, value); | 863 float multiplier = convertLineWidth<float>(state, value); |
866 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::Uni
tType::Ems)->computeLength<float>(state.cssToLengthConversionData()); | 864 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::Uni
tType::Ems)->computeLength<float>(state.cssToLengthConversionData()); |
867 } | 865 } |
868 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); | 866 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale
3D); | 963 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale
3D); |
966 } | 964 } |
967 | 965 |
968 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style
ResolverState& state, CSSValue* value) | 966 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style
ResolverState& state, CSSValue* value) |
969 { | 967 { |
970 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 968 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
971 return primitiveValue->getValueID() == CSSValueFromImage ? RespectImageOrien
tation : DoNotRespectImageOrientation; | 969 return primitiveValue->getValueID() == CSSValueFromImage ? RespectImageOrien
tation : DoNotRespectImageOrientation; |
972 } | 970 } |
973 | 971 |
974 } // namespace blink | 972 } // namespace blink |
OLD | NEW |