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

Side by Side Diff: Source/core/rendering/style/ShapeValue.h

Issue 144143005: Preserve shape-box order in non-computed values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating patch to trunk Created 6 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
« no previous file with comments | « Source/core/rendering/style/BasicShapes.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 30 matching lines...) Expand all
41 class ShapeValue : public RefCounted<ShapeValue> { 41 class ShapeValue : public RefCounted<ShapeValue> {
42 public: 42 public:
43 enum ShapeValueType { 43 enum ShapeValueType {
44 // The Auto value is defined by a null ShapeValue* 44 // The Auto value is defined by a null ShapeValue*
45 Shape, 45 Shape,
46 Box, 46 Box,
47 Outside, 47 Outside,
48 Image 48 Image
49 }; 49 };
50 50
51 static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape) 51 static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
52 { 52 {
53 return adoptRef(new ShapeValue(shape)); 53 return adoptRef(new ShapeValue(shape, layoutBox));
54 } 54 }
55 55
56 static PassRefPtr<ShapeValue> createOutsideValue() 56 static PassRefPtr<ShapeValue> createOutsideValue()
57 { 57 {
58 return adoptRef(new ShapeValue(Outside)); 58 return adoptRef(new ShapeValue(Outside));
59 } 59 }
60 60
61 static PassRefPtr<ShapeValue> createLayoutBoxValue(LayoutBox layoutBox) 61 static PassRefPtr<ShapeValue> createLayoutBoxValue(LayoutBox layoutBox)
62 { 62 {
63 return adoptRef(new ShapeValue(layoutBox)); 63 return adoptRef(new ShapeValue(layoutBox));
(...skipping 14 matching lines...) Expand all
78 ASSERT(type() == Image); 78 ASSERT(type() == Image);
79 if (m_image != image) 79 if (m_image != image)
80 m_image = image; 80 m_image = image;
81 } 81 }
82 LayoutBox layoutBox() const { return m_layoutBox; } 82 LayoutBox layoutBox() const { return m_layoutBox; }
83 void setLayoutBox(LayoutBox layoutBox) { m_layoutBox = layoutBox; } 83 void setLayoutBox(LayoutBox layoutBox) { m_layoutBox = layoutBox; }
84 84
85 bool operator==(const ShapeValue& other) const; 85 bool operator==(const ShapeValue& other) const;
86 86
87 private: 87 private:
88 ShapeValue(PassRefPtr<BasicShape> shape) 88 ShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
89 : m_type(Shape) 89 : m_type(Shape)
90 , m_shape(shape) 90 , m_shape(shape)
91 , m_layoutBox(m_shape->layoutBox()) 91 , m_layoutBox(layoutBox)
92 { 92 {
93 } 93 }
94 ShapeValue(ShapeValueType type) 94 ShapeValue(ShapeValueType type)
95 : m_type(type) 95 : m_type(type)
96 , m_layoutBox(BoxMissing) 96 , m_layoutBox(BoxMissing)
97 { 97 {
98 } 98 }
99 ShapeValue(PassRefPtr<StyleImage> image) 99 ShapeValue(PassRefPtr<StyleImage> image)
100 : m_type(Image) 100 : m_type(Image)
101 , m_image(image) 101 , m_image(image)
(...skipping 29 matching lines...) Expand all
131 return image() == other.image(); 131 return image() == other.image();
132 } 132 }
133 133
134 ASSERT_NOT_REACHED(); 134 ASSERT_NOT_REACHED();
135 return false; 135 return false;
136 } 136 }
137 137
138 } 138 }
139 139
140 #endif 140 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/style/BasicShapes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698