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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 } | 748 } |
749 | 749 |
750 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue*
value) | 750 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue*
value) |
751 { | 751 { |
752 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 752 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
753 if (primitiveValue->getValueID() == CSSValueNormal) | 753 if (primitiveValue->getValueID() == CSSValueNormal) |
754 return 0; | 754 return 0; |
755 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); | 755 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); |
756 } | 756 } |
757 | 757 |
758 PassRefPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDasharray(StyleRes
olverState&, CSSValue* value) | 758 PassRefPtrWillBeRawPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDashar
ray(StyleResolverState&, CSSValue* value) |
759 { | 759 { |
760 if (!value->isValueList()) { | 760 if (!value->isValueList()) |
761 return SVGRenderStyle::initialStrokeDashArray(); | 761 return SVGRenderStyle::initialStrokeDashArray(); |
762 } | |
763 | 762 |
764 CSSValueList* dashes = toCSSValueList(value); | 763 CSSValueList* dashes = toCSSValueList(value); |
765 | 764 |
766 RefPtr<SVGLengthList> array = SVGLengthList::create(); | 765 RefPtrWillBeRawPtr<SVGLengthList> array = SVGLengthList::create(); |
767 size_t length = dashes->length(); | 766 size_t length = dashes->length(); |
768 for (size_t i = 0; i < length; ++i) { | 767 for (size_t i = 0; i < length; ++i) { |
769 CSSValue* currValue = dashes->item(i); | 768 CSSValue* currValue = dashes->item(i); |
770 if (!currValue->isPrimitiveValue()) | 769 if (!currValue->isPrimitiveValue()) |
771 continue; | 770 continue; |
772 | 771 |
773 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i)); | 772 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i)); |
774 array->append(SVGLength::fromCSSPrimitiveValue(dash)); | 773 array->append(SVGLength::fromCSSPrimitiveValue(dash)); |
775 } | 774 } |
776 | 775 |
(...skipping 10 matching lines...) Expand all Loading... |
787 | 786 |
788 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue
* value) | 787 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue
* value) |
789 { | 788 { |
790 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 789 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
791 if (primitiveValue->isRGBColor()) | 790 if (primitiveValue->isRGBColor()) |
792 return primitiveValue->getRGBA32Value(); | 791 return primitiveValue->getRGBA32Value(); |
793 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); | 792 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); |
794 return state.style()->color(); | 793 return state.style()->color(); |
795 } | 794 } |
796 | 795 |
797 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState
&, CSSValue* value) | 796 PassRefPtrWillBeRawPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleR
esolverState&, CSSValue* value) |
798 { | 797 { |
799 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); | 798 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); |
800 } | 799 } |
801 | 800 |
802 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C
SSValue* value) | 801 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C
SSValue* value) |
803 { | 802 { |
804 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 803 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
805 if (primitiveValue->getValueID()) { | 804 if (primitiveValue->getValueID()) { |
806 float multiplier = convertLineWidth<float>(state, value); | 805 float multiplier = convertLineWidth<float>(state, value); |
807 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS
_EMS)->computeLength<float>(state.cssToLengthConversionData()); | 806 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS
_EMS)->computeLength<float>(state.cssToLengthConversionData()); |
(...skipping 11 matching lines...) Expand all Loading... |
819 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); | 818 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); |
820 | 819 |
821 return TransformOrigin( | 820 return TransformOrigin( |
822 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX)
, | 821 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX)
, |
823 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY)
, | 822 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY)
, |
824 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu
eZ) | 823 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu
eZ) |
825 ); | 824 ); |
826 } | 825 } |
827 | 826 |
828 } // namespace blink | 827 } // namespace blink |
OLD | NEW |