Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 975733002: Use Length for the stroke-dasharray property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test for style-change responsive-ness. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 797 }
798 798
799 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value) 799 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value)
800 { 800 {
801 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 801 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
802 if (primitiveValue->getValueID() == CSSValueNormal) 802 if (primitiveValue->getValueID() == CSSValueNormal)
803 return 0; 803 return 0;
804 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); 804 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( ));
805 } 805 }
806 806
807 PassRefPtrWillBeRawPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDashar ray(StyleResolverState&, CSSValue* value) 807 PassRefPtr<SVGDashArray> StyleBuilderConverter::convertStrokeDasharray(StyleReso lverState& state, CSSValue* value)
808 { 808 {
809 if (!value->isValueList()) 809 if (!value->isValueList())
810 return SVGLayoutStyle::initialStrokeDashArray(); 810 return SVGLayoutStyle::initialStrokeDashArray();
811 811
812 CSSValueList* dashes = toCSSValueList(value); 812 CSSValueList* dashes = toCSSValueList(value);
813 813
814 RefPtrWillBeRawPtr<SVGLengthList> array = SVGLengthList::create(); 814 RefPtr<SVGDashArray> array = SVGDashArray::create();
815 size_t length = dashes->length(); 815 size_t length = dashes->length();
816 for (size_t i = 0; i < length; ++i) { 816 for (size_t i = 0; i < length; ++i) {
817 CSSValue* currValue = dashes->item(i); 817 CSSValue* currValue = dashes->item(i);
818 if (!currValue->isPrimitiveValue()) 818 if (!currValue->isPrimitiveValue())
819 continue; 819 continue;
820 820
821 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i)); 821 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i));
822 array->append(SVGLength::fromCSSPrimitiveValue(dash)); 822 array->append(convertLength(state, dash));
823 } 823 }
824 824
825 return array.release(); 825 return array.release();
826 } 826 }
827 827
828 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C SSValue* value, bool forVisitedLink) 828 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C SSValue* value, bool forVisitedLink)
829 { 829 {
830 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 830 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
831 if (primitiveValue->getValueID() == CSSValueCurrentcolor) 831 if (primitiveValue->getValueID() == CSSValueCurrentcolor)
832 return StyleColor::currentColor(); 832 return StyleColor::currentColor();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); 867 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2));
868 868
869 return TransformOrigin( 869 return TransformOrigin(
870 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 870 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
871 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , 871 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) ,
872 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) 872 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ)
873 ); 873 );
874 } 874 }
875 875
876 } // namespace blink 876 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698