diff options
-rw-r--r-- | dw/style.cc | 4 | ||||
-rw-r--r-- | dw/style.hh | 8 | ||||
-rw-r--r-- | src/cssparser.cc | 7 | ||||
-rw-r--r-- | src/styleengine.cc | 3 |
4 files changed, 20 insertions, 2 deletions
diff --git a/dw/style.cc b/dw/style.cc index 30597af2..d315382c 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -49,6 +49,7 @@ void StyleAttrs::initValues () margin.setVal (0); borderWidth.setVal (0); padding.setVal (0); + borderCollapse = BORDER_MODEL_SEPARATE; setBorderColor (NULL); setBorderStyle (BORDER_NONE); hBorderSpacing = 0; @@ -123,6 +124,7 @@ bool StyleAttrs::equals (object::Object *other) { margin.equals (&otherAttrs->margin) && borderWidth.equals (&otherAttrs->borderWidth) && padding.equals (&otherAttrs->padding) && + borderCollapse == otherAttrs->borderCollapse && borderColor.top == otherAttrs->borderColor.top && borderColor.right == otherAttrs->borderColor.right && borderColor.bottom == otherAttrs->borderColor.bottom && @@ -158,6 +160,7 @@ int StyleAttrs::hashValue () { margin.hashValue () + borderWidth.hashValue () + padding.hashValue () + + borderCollapse + (intptr_t) borderColor.top + (intptr_t) borderColor.right + (intptr_t) borderColor.bottom + @@ -246,6 +249,7 @@ void Style::copyAttrs (StyleAttrs *attrs) margin = attrs->margin; borderWidth = attrs->borderWidth; padding = attrs->padding; + borderCollapse = attrs->borderCollapse; borderColor = attrs->borderColor; borderStyle = attrs->borderStyle; display = attrs->display; diff --git a/dw/style.hh b/dw/style.hh index 33d42c29..0fbd2a84 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -193,7 +193,7 @@ namespace core { namespace style { enum Cursor { - CURSOR_COSSHAIR, + CURSOR_CROSSHAIR, CURSOR_DEFAULT, CURSOR_POINTER, CURSOR_MOVE, @@ -210,6 +210,11 @@ enum Cursor { CURSOR_HELP }; +enum BorderCollapse { + BORDER_MODEL_SEPARATE, + BORDER_MODEL_COLLAPSE +}; + enum BorderStyle { BORDER_NONE, BORDER_HIDDEN, @@ -435,6 +440,7 @@ public: Length width, height, lineHeight; Box margin, borderWidth, padding; + BorderCollapse borderCollapse; struct { Color *top, *right, *bottom, *left; } borderColor; struct { BorderStyle top, right, bottom, left; } borderStyle; diff --git a/src/cssparser.cc b/src/cssparser.cc index 23085352..e9de3aaf 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -47,6 +47,10 @@ typedef struct { const char *const *enum_symbols; } CssPropertyInfo; +static const char *const Css_border_collapse_enum_vals[] = { + "separate", "collapse", NULL +}; + static const char *const Css_border_style_enum_vals[] = { "none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", NULL @@ -137,7 +141,8 @@ const CssPropertyInfo Css_property_info[CSS_PROPERTY_LAST] = { Css_border_style_enum_vals}, {"border-bottom-width", {CSS_TYPE_ENUM, CSS_TYPE_LENGTH, CSS_TYPE_UNUSED}, Css_border_width_enum_vals}, - {"border-collapse", {CSS_TYPE_UNUSED}, NULL}, + {"border-collapse", {CSS_TYPE_ENUM, CSS_TYPE_UNUSED}, + Css_border_collapse_enum_vals}, {"border-left-color", {CSS_TYPE_COLOR, CSS_TYPE_UNUSED}, NULL}, {"border-left-style", {CSS_TYPE_ENUM, CSS_TYPE_UNUSED}, Css_border_style_enum_vals}, diff --git a/src/styleengine.cc b/src/styleengine.cc index 62ba60d7..a381b1c6 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -434,6 +434,9 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props) { //attrs->backgroundColor = Color::create(layout, 0xdcd1ba); attrs->backgroundColor = Color::create(layout, 0xe0e0a3); break; + case CSS_PROPERTY_BORDER_COLLAPSE: + attrs->borderCollapse = (BorderCollapse) p->value.intVal; + break; case CSS_PROPERTY_BORDER_TOP_COLOR: attrs->borderColor.top = Color::create (layout, p->value.intVal); |