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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 float StyleBuilderConverter::convertNumberOrPercentage( | 850 float StyleBuilderConverter::convertNumberOrPercentage( |
851 StyleResolverState& state, | 851 StyleResolverState& state, |
852 const CSSValue& value) { | 852 const CSSValue& value) { |
853 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 853 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
854 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); | 854 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); |
855 if (primitiveValue.isNumber()) | 855 if (primitiveValue.isNumber()) |
856 return primitiveValue.getFloatValue(); | 856 return primitiveValue.getFloatValue(); |
857 return primitiveValue.getFloatValue() / 100.0f; | 857 return primitiveValue.getFloatValue() / 100.0f; |
858 } | 858 } |
859 | 859 |
860 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotation( | 860 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotate( |
861 StyleResolverState&, | 861 StyleResolverState&, |
862 const CSSValue& value) { | 862 const CSSValue& value) { |
863 return convertOffsetRotation(value); | 863 return convertOffsetRotate(value); |
864 } | 864 } |
865 | 865 |
866 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotation( | 866 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotate( |
867 const CSSValue& value) { | 867 const CSSValue& value) { |
868 StyleOffsetRotation result(0, OffsetRotationFixed); | 868 StyleOffsetRotation result(0, OffsetRotationFixed); |
869 | 869 |
870 const CSSValueList& list = toCSSValueList(value); | 870 const CSSValueList& list = toCSSValueList(value); |
871 ASSERT(list.length() == 1 || list.length() == 2); | 871 ASSERT(list.length() == 1 || list.length() == 2); |
872 for (const auto& item : list) { | 872 for (const auto& item : list) { |
873 if (item->isIdentifierValue() && | 873 if (item->isIdentifierValue() && |
874 toCSSIdentifierValue(*item).getValueID() == CSSValueAuto) { | 874 toCSSIdentifierValue(*item).getValueID() == CSSValueAuto) { |
875 result.type = OffsetRotationAuto; | 875 result.type = OffsetRotationAuto; |
876 } else if (item->isIdentifierValue() && | 876 } else if (item->isIdentifierValue() && |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 // Instead of the actual zoom, use 1 to avoid potential rounding errors | 1276 // Instead of the actual zoom, use 1 to avoid potential rounding errors |
1277 Length length = primitiveValue.convertToLength( | 1277 Length length = primitiveValue.convertToLength( |
1278 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); | 1278 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); |
1279 return *CSSPrimitiveValue::create(length, 1); | 1279 return *CSSPrimitiveValue::create(length, 1); |
1280 } | 1280 } |
1281 } | 1281 } |
1282 return value; | 1282 return value; |
1283 } | 1283 } |
1284 | 1284 |
1285 } // namespace blink | 1285 } // namespace blink |
OLD | NEW |