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 27 matching lines...) Expand all Loading... |
38 #include "core/css/CSSPathValue.h" | 38 #include "core/css/CSSPathValue.h" |
39 #include "core/css/CSSPrimitiveValueMappings.h" | 39 #include "core/css/CSSPrimitiveValueMappings.h" |
40 #include "core/css/CSSQuadValue.h" | 40 #include "core/css/CSSQuadValue.h" |
41 #include "core/css/CSSReflectValue.h" | 41 #include "core/css/CSSReflectValue.h" |
42 #include "core/css/CSSShadowValue.h" | 42 #include "core/css/CSSShadowValue.h" |
43 #include "core/css/CSSStringValue.h" | 43 #include "core/css/CSSStringValue.h" |
44 #include "core/css/CSSURIValue.h" | 44 #include "core/css/CSSURIValue.h" |
45 #include "core/css/CSSValuePair.h" | 45 #include "core/css/CSSValuePair.h" |
46 #include "core/css/resolver/FilterOperationResolver.h" | 46 #include "core/css/resolver/FilterOperationResolver.h" |
47 #include "core/frame/LocalFrame.h" | 47 #include "core/frame/LocalFrame.h" |
| 48 #include "core/style/TextSizeAdjust.h" |
48 #include "core/svg/SVGURIReference.h" | 49 #include "core/svg/SVGURIReference.h" |
49 #include "platform/transforms/RotateTransformOperation.h" | 50 #include "platform/transforms/RotateTransformOperation.h" |
50 #include "platform/transforms/ScaleTransformOperation.h" | 51 #include "platform/transforms/ScaleTransformOperation.h" |
51 #include "platform/transforms/TranslateTransformOperation.h" | 52 #include "platform/transforms/TranslateTransformOperation.h" |
52 #include <algorithm> | 53 #include <algorithm> |
53 | 54 |
54 namespace blink { | 55 namespace blink { |
55 | 56 |
56 namespace { | 57 namespace { |
57 | 58 |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, c
onst CSSValue& value) | 931 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, c
onst CSSValue& value) |
931 { | 932 { |
932 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 933 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
933 if (primitiveValue.getValueID()) { | 934 if (primitiveValue.getValueID()) { |
934 float multiplier = convertLineWidth<float>(state, value); | 935 float multiplier = convertLineWidth<float>(state, value); |
935 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::Uni
tType::Ems)->computeLength<float>(state.cssToLengthConversionData()); | 936 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::Uni
tType::Ems)->computeLength<float>(state.cssToLengthConversionData()); |
936 } | 937 } |
937 return primitiveValue.computeLength<float>(state.cssToLengthConversionData()
); | 938 return primitiveValue.computeLength<float>(state.cssToLengthConversionData()
); |
938 } | 939 } |
939 | 940 |
| 941 TextSizeAdjust StyleBuilderConverter::convertTextSizeAdjust(StyleResolverState&
state, const CSSValue& value) |
| 942 { |
| 943 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 944 if (primitiveValue.getValueID() == CSSValueNone) |
| 945 return TextSizeAdjust::adjustNone(); |
| 946 if (primitiveValue.getValueID() == CSSValueAuto) |
| 947 return TextSizeAdjust::adjustAuto(); |
| 948 DCHECK(primitiveValue.isPercentage()); |
| 949 return TextSizeAdjust(primitiveValue.getFloatValue() / 100.0f); |
| 950 } |
| 951 |
940 TransformOrigin StyleBuilderConverter::convertTransformOrigin(StyleResolverState
& state, const CSSValue& value) | 952 TransformOrigin StyleBuilderConverter::convertTransformOrigin(StyleResolverState
& state, const CSSValue& value) |
941 { | 953 { |
942 const CSSValueList& list = toCSSValueList(value); | 954 const CSSValueList& list = toCSSValueList(value); |
943 ASSERT(list.length() == 3); | 955 ASSERT(list.length() == 3); |
944 | 956 |
945 const CSSPrimitiveValue& primitiveValueX = toCSSPrimitiveValue(list.item(0))
; | 957 const CSSPrimitiveValue& primitiveValueX = toCSSPrimitiveValue(list.item(0))
; |
946 const CSSPrimitiveValue& primitiveValueY = toCSSPrimitiveValue(list.item(1))
; | 958 const CSSPrimitiveValue& primitiveValueY = toCSSPrimitiveValue(list.item(1))
; |
947 const CSSPrimitiveValue& primitiveValueZ = toCSSPrimitiveValue(list.item(2))
; | 959 const CSSPrimitiveValue& primitiveValueZ = toCSSPrimitiveValue(list.item(2))
; |
948 | 960 |
949 return TransformOrigin( | 961 return TransformOrigin( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 | 1058 |
1047 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) | 1059 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) |
1048 { | 1060 { |
1049 if (value.isPathValue()) | 1061 if (value.isPathValue()) |
1050 return toCSSPathValue(value).stylePath(); | 1062 return toCSSPathValue(value).stylePath(); |
1051 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); | 1063 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); |
1052 return nullptr; | 1064 return nullptr; |
1053 } | 1065 } |
1054 | 1066 |
1055 } // namespace blink | 1067 } // namespace blink |
OLD | NEW |