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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 742 |
743 float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state
, const CSSValue& value) | 743 float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state
, const CSSValue& value) |
744 { | 744 { |
745 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 745 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
746 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); | 746 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); |
747 if (primitiveValue.isNumber()) | 747 if (primitiveValue.isNumber()) |
748 return primitiveValue.getFloatValue(); | 748 return primitiveValue.getFloatValue(); |
749 return primitiveValue.getFloatValue() / 100.0f; | 749 return primitiveValue.getFloatValue() / 100.0f; |
750 } | 750 } |
751 | 751 |
752 StyleMotionRotation StyleBuilderConverter::convertMotionRotation(StyleResolverSt
ate&, const CSSValue& value) | 752 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotation(StyleResolverSt
ate&, const CSSValue& value) |
753 { | 753 { |
754 return convertMotionRotation(value); | 754 return convertOffsetRotation(value); |
755 } | 755 } |
756 | 756 |
757 StyleMotionRotation StyleBuilderConverter::convertMotionRotation(const CSSValue&
value) | 757 StyleOffsetRotation StyleBuilderConverter::convertOffsetRotation(const CSSValue&
value) |
758 { | 758 { |
759 StyleMotionRotation result(0, MotionRotationFixed); | 759 StyleOffsetRotation result(0, OffsetRotationFixed); |
760 | 760 |
761 const CSSValueList& list = toCSSValueList(value); | 761 const CSSValueList& list = toCSSValueList(value); |
762 ASSERT(list.length() == 1 || list.length() == 2); | 762 ASSERT(list.length() == 1 || list.length() == 2); |
763 for (const auto& item : list) { | 763 for (const auto& item : list) { |
764 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*item); | 764 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*item); |
765 if (primitiveValue.getValueID() == CSSValueAuto) { | 765 if (primitiveValue.getValueID() == CSSValueAuto) { |
766 result.type = MotionRotationAuto; | 766 result.type = OffsetRotationAuto; |
767 } else if (primitiveValue.getValueID() == CSSValueReverse) { | 767 } else if (primitiveValue.getValueID() == CSSValueReverse) { |
768 result.type = MotionRotationAuto; | 768 result.type = OffsetRotationAuto; |
769 result.angle += 180; | 769 result.angle += 180; |
770 } else { | 770 } else { |
771 result.angle += primitiveValue.computeDegrees(); | 771 result.angle += primitiveValue.computeDegrees(); |
772 } | 772 } |
773 } | 773 } |
774 result.angle = clampTo<float>(result.angle); | 774 result.angle = clampTo<float>(result.angle); |
775 | 775 |
776 return result; | 776 return result; |
777 } | 777 } |
778 | 778 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 return nullptr; | 1101 return nullptr; |
1102 } | 1102 } |
1103 | 1103 |
1104 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl
eResolverState& state, const CSSValue& value) | 1104 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl
eResolverState& state, const CSSValue& value) |
1105 { | 1105 { |
1106 // TODO(timloh): Resolve ems, etc. | 1106 // TODO(timloh): Resolve ems, etc. |
1107 return value; | 1107 return value; |
1108 } | 1108 } |
1109 | 1109 |
1110 } // namespace blink | 1110 } // namespace blink |
OLD | NEW |