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

Side by Side Diff: Source/core/layout/style/SVGLayoutStyleTest.cpp

Issue 962763003: Use Length for the stroke-dashoffset property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make font-size explicit. 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/layout/style/SVGLayoutStyle.h" 6 #include "core/layout/style/SVGLayoutStyle.h"
7 7
8 #include "core/layout/ClipPathOperation.h" 8 #include "core/layout/ClipPathOperation.h"
9 #include "core/layout/style/ShapeValue.h" 9 #include "core/layout/style/ShapeValue.h"
10 10
(...skipping 25 matching lines...) Expand all
36 svg1->set##fieldName(SVGLayoutStyle::initial##fieldName()); \ 36 svg1->set##fieldName(SVGLayoutStyle::initial##fieldName()); \
37 svg2->set##fieldName(SVGLayoutStyle::initial##fieldName()); \ 37 svg2->set##fieldName(SVGLayoutStyle::initial##fieldName()); \
38 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); \ 38 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); \
39 } 39 }
40 40
41 TEST(SVGLayoutStyleTest, StrokeStyleShouldCompareValue) 41 TEST(SVGLayoutStyleTest, StrokeStyleShouldCompareValue)
42 { 42 {
43 TEST_STYLE_VALUE_NO_DIFF(float, StrokeOpacity); 43 TEST_STYLE_VALUE_NO_DIFF(float, StrokeOpacity);
44 TEST_STYLE_VALUE_NO_DIFF(float, StrokeMiterLimit); 44 TEST_STYLE_VALUE_NO_DIFF(float, StrokeMiterLimit);
45 TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGLength, StrokeWidth); 45 TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGLength, StrokeWidth);
46 TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGLength, StrokeDashOffset); 46 TEST_STYLE_VALUE_NO_DIFF(Length, StrokeDashOffset);
47 TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGLengthList, StrokeDashArray); 47 TEST_STYLE_REFPTR_VALUE_NO_DIFF(SVGLengthList, StrokeDashArray);
48 48
49 { 49 {
50 RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create(); 50 RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create();
51 RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create(); 51 RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create();
52 svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false); 52 svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false);
53 svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false); 53 svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), true, false);
54 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); 54 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference());
55 } 55 }
56 { 56 {
57 RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create(); 57 RefPtr<SVGLayoutStyle> svg1 = SVGLayoutStyle::create();
58 RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create(); 58 RefPtr<SVGLayoutStyle> svg2 = SVGLayoutStyle::create();
59 svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false , true); 59 svg1->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false , true);
60 svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false , true); 60 svg2->setStrokePaint(SVGLayoutStyle::initialStrokePaintType(), SVGLayout Style::initialStrokePaintColor(), SVGLayoutStyle::initialStrokePaintUri(), false , true);
61 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference()); 61 EXPECT_FALSE(svg1->diff(svg2.get()).hasDifference());
62 } 62 }
63 } 63 }
64 64
65 TEST(SVGLayoutStyleTest, MiscStyleShouldCompareValue) 65 TEST(SVGLayoutStyleTest, MiscStyleShouldCompareValue)
66 { 66 {
67 TEST_STYLE_VALUE_NO_DIFF(Color, FloodColor); 67 TEST_STYLE_VALUE_NO_DIFF(Color, FloodColor);
68 TEST_STYLE_VALUE_NO_DIFF(float, FloodOpacity); 68 TEST_STYLE_VALUE_NO_DIFF(float, FloodOpacity);
69 TEST_STYLE_VALUE_NO_DIFF(Color, LightingColor); 69 TEST_STYLE_VALUE_NO_DIFF(Color, LightingColor);
70 TEST_STYLE_VALUE_NO_DIFF(Length, BaselineShiftValue); 70 TEST_STYLE_VALUE_NO_DIFF(Length, BaselineShiftValue);
71 } 71 }
72 72
73 } 73 }
OLDNEW
« no previous file with comments | « Source/core/layout/style/SVGLayoutStyleDefs.cpp ('k') | Source/core/layout/svg/SVGLayoutSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698