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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 } | 312 } |
313 return ligatures; | 313 return ligatures; |
314 } | 314 } |
315 | 315 |
316 ASSERT_WITH_SECURITY_IMPLICATION(value.isPrimitiveValue()); | 316 ASSERT_WITH_SECURITY_IMPLICATION(value.isPrimitiveValue()); |
317 ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueNormal); | 317 ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueNormal); |
318 return FontDescription::VariantLigatures(); | 318 return FontDescription::VariantLigatures(); |
319 } | 319 } |
320 | 320 |
321 EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt
ate&, const CSSValue& value) | |
322 { | |
323 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | |
324 if (primitiveValue.typeWithCalcResolved() != CSSPrimitiveValue::UnitType::De
grees) | |
325 return GO_0DEG; | |
326 | |
327 float angle = fabsf(fmodf(primitiveValue.getFloatValue(), 360.0f)); | |
328 | |
329 if (angle <= 45.0f || angle > 315.0f) | |
330 return GO_0DEG; | |
331 if (angle > 45.0f && angle <= 135.0f) | |
332 return GO_90DEG; | |
333 if (angle > 135.0f && angle <= 225.0f) | |
334 return GO_180DEG; | |
335 return GO_270DEG; | |
336 } | |
337 | |
338 StyleSelfAlignmentData StyleBuilderConverter::convertSelfOrDefaultAlignmentData(
StyleResolverState&, const CSSValue& value) | 321 StyleSelfAlignmentData StyleBuilderConverter::convertSelfOrDefaultAlignmentData(
StyleResolverState&, const CSSValue& value) |
339 { | 322 { |
340 StyleSelfAlignmentData alignmentData = ComputedStyle::initialSelfAlignment()
; | 323 StyleSelfAlignmentData alignmentData = ComputedStyle::initialSelfAlignment()
; |
341 if (value.isValuePair()) { | 324 if (value.isValuePair()) { |
342 const CSSValuePair& pair = toCSSValuePair(value); | 325 const CSSValuePair& pair = toCSSValuePair(value); |
343 if (toCSSPrimitiveValue(pair.first()).getValueID() == CSSValueLegacy) { | 326 if (toCSSPrimitiveValue(pair.first()).getValueID() == CSSValueLegacy) { |
344 alignmentData.setPositionType(LegacyPosition); | 327 alignmentData.setPositionType(LegacyPosition); |
345 alignmentData.setPosition(toCSSPrimitiveValue(pair.second()).convert
To<ItemPosition>()); | 328 alignmentData.setPosition(toCSSPrimitiveValue(pair.second()).convert
To<ItemPosition>()); |
346 } else { | 329 } else { |
347 alignmentData.setPosition(toCSSPrimitiveValue(pair.first()).convertT
o<ItemPosition>()); | 330 alignmentData.setPosition(toCSSPrimitiveValue(pair.first()).convertT
o<ItemPosition>()); |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale
3D); | 946 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale
3D); |
964 } | 947 } |
965 | 948 |
966 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style
ResolverState& state, const CSSValue& value) | 949 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style
ResolverState& state, const CSSValue& value) |
967 { | 950 { |
968 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 951 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
969 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient
ation : DoNotRespectImageOrientation; | 952 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient
ation : DoNotRespectImageOrientation; |
970 } | 953 } |
971 | 954 |
972 } // namespace blink | 955 } // namespace blink |
OLD | NEW |