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

Unified Diff: Source/core/rendering/style/ExclusionShapeValue.h

Issue 16358010: [CSS Exclusions] Add CSS parsing support for image URI shape-inside and shape-outside values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/style/ExclusionShapeValue.h
diff --git a/Source/core/rendering/style/ExclusionShapeValue.h b/Source/core/rendering/style/ExclusionShapeValue.h
index 874ad3ccdd8cab85c427e2bae3791d313f2b8789..c7ee9fa5cd63722d6626517ec661b9d716a4a53f 100644
--- a/Source/core/rendering/style/ExclusionShapeValue.h
+++ b/Source/core/rendering/style/ExclusionShapeValue.h
@@ -31,16 +31,18 @@
#define ExclusionShapeValue_h
#include "core/rendering/style/BasicShapes.h"
-#include <wtf/PassRefPtr.h>
+#include "core/rendering/style/StyleImage.h"
+#include "wtf/PassRefPtr.h"
namespace WebCore {
class ExclusionShapeValue : public RefCounted<ExclusionShapeValue> {
public:
enum ExclusionShapeValueType {
- // The AUTO value is defined by a null ExclusionShapeValue*
- SHAPE,
- OUTSIDE
+ // The Auto value is defined by a null ExclusionShapeValue*
+ Shape,
+ Outside,
+ Image
};
static PassRefPtr<ExclusionShapeValue> createShapeValue(PassRefPtr<BasicShape> shape)
@@ -50,18 +52,42 @@ public:
static PassRefPtr<ExclusionShapeValue> createOutsideValue()
{
- return adoptRef(new ExclusionShapeValue(OUTSIDE));
+ return adoptRef(new ExclusionShapeValue(Outside));
+ }
+
+ static PassRefPtr<ExclusionShapeValue> createImageValue(PassRefPtr<StyleImage> image)
+ {
+ return adoptRef(new ExclusionShapeValue(image));
}
ExclusionShapeValueType type() const { return m_type; }
BasicShape* shape() const { return m_shape.get(); }
+ StyleImage* image() const { return m_image.get(); }
+ void setImage(PassRefPtr<StyleImage> image)
+ {
+ if (m_image != image)
eseidel 2013/06/04 18:10:36 Why bother avoiding?
+ m_image = image;
+ }
bool operator==(const ExclusionShapeValue& other) const { return type() == other.type(); }
private:
- ExclusionShapeValue(PassRefPtr<BasicShape> shape) : m_type(SHAPE), m_shape(shape) { }
- ExclusionShapeValue(ExclusionShapeValueType type) : m_type(type) { }
+ ExclusionShapeValue(PassRefPtr<BasicShape> shape)
+ : m_type(Shape)
+ , m_shape(shape)
+ {
+ }
+ ExclusionShapeValue(ExclusionShapeValueType type)
+ : m_type(type)
+ {
+ }
+ ExclusionShapeValue(PassRefPtr<StyleImage> image)
+ : m_type(Image)
+ , m_image(image)
+ {
+ }
ExclusionShapeValueType m_type;
RefPtr<BasicShape> m_shape;
+ RefPtr<StyleImage> m_image;
};
}

Powered by Google App Engine
This is Rietveld 408576698