aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/style.cc20
-rw-r--r--dw/style.hh16
2 files changed, 36 insertions, 0 deletions
diff --git a/dw/style.cc b/dw/style.cc
index 4409bb43..1ea0a9c4 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -49,6 +49,10 @@ void StyleAttrs::initValues ()
valign = VALIGN_BASELINE;
backgroundColor = NULL;
backgroundImage = NULL;
+ backgroundRepeat = BACKGROUND_REPEAT;
+ backgroundAttachment = BACKGROUND_ATTACHMENT_SCROLL;
+ backgroundPositionX = createPerLength (0);
+ backgroundPositionY = createPerLength (0);
width = height = lineHeight = LENGTH_AUTO;
textIndent = 0;
margin.setVal (0);
@@ -78,6 +82,10 @@ void StyleAttrs::resetValues ()
textAlignChar = '.';
backgroundColor = NULL;
backgroundImage = NULL;
+ backgroundRepeat = BACKGROUND_REPEAT;
+ backgroundAttachment = BACKGROUND_ATTACHMENT_SCROLL;
+ backgroundPositionX = createPerLength (0);
+ backgroundPositionY = createPerLength (0);
width = LENGTH_AUTO;
height = LENGTH_AUTO;
@@ -119,6 +127,10 @@ bool StyleAttrs::equals (object::Object *other) {
color == otherAttrs->color &&
backgroundColor == otherAttrs->backgroundColor &&
backgroundImage == otherAttrs->backgroundImage &&
+ backgroundRepeat == otherAttrs->backgroundRepeat &&
+ backgroundAttachment == otherAttrs->backgroundAttachment &&
+ backgroundPositionX == otherAttrs->backgroundPositionX &&
+ backgroundPositionY == otherAttrs->backgroundPositionY &&
textAlign == otherAttrs->textAlign &&
valign == otherAttrs->valign &&
textAlignChar == otherAttrs->textAlignChar &&
@@ -160,6 +172,10 @@ int StyleAttrs::hashValue () {
(intptr_t) color +
(intptr_t) backgroundColor +
(intptr_t) backgroundImage +
+ backgroundRepeat +
+ backgroundAttachment +
+ backgroundPositionX +
+ backgroundPositionY +
textAlign +
valign +
textAlignChar +
@@ -257,6 +273,10 @@ void Style::copyAttrs (StyleAttrs *attrs)
color = attrs->color;
backgroundColor = attrs->backgroundColor;
backgroundImage = attrs->backgroundImage;
+ backgroundRepeat = attrs->backgroundRepeat;
+ backgroundAttachment = attrs->backgroundAttachment;
+ backgroundPositionX = attrs->backgroundPositionX;
+ backgroundPositionY = attrs->backgroundPositionY;
textAlign = attrs->textAlign;
valign = attrs->valign;
textAlignChar = attrs->textAlignChar;
diff --git a/dw/style.hh b/dw/style.hh
index 6c82be8d..c09a52f0 100644
--- a/dw/style.hh
+++ b/dw/style.hh
@@ -230,6 +230,18 @@ enum BorderStyle {
BORDER_OUTSET
};
+enum BackgroundRepeat {
+ BACKGROUND_REPEAT,
+ BACKGROUND_REPEAT_X,
+ BACKGROUND_REPEAT_Y,
+ BACKGROUND_NO_REPEAT
+};
+
+enum BackgroundAttachment {
+ BACKGROUND_ATTACHMENT_SCROLL,
+ BACKGROUND_ATTACHMENT_FIXED
+};
+
enum TextAlignType {
TEXT_ALIGN_LEFT,
TEXT_ALIGN_RIGHT,
@@ -449,6 +461,10 @@ public:
* TextDecoration <-> int */
Color *color, *backgroundColor;
StyleImage *backgroundImage;
+ BackgroundRepeat backgroundRepeat;
+ BackgroundAttachment backgroundAttachment;
+ Length backgroundPositionX; // "left" defiened by "0%" etc. (see CSS spec)
+ Length backgroundPositionY; // "top" defiened by "0%" etc. (see CSS spec)
TextAlignType textAlign;
VAlignType valign;