diff options
-rw-r--r-- | src/css.cc | 15 | ||||
-rw-r--r-- | src/css.hh | 3 | ||||
-rw-r--r-- | src/cssparser.cc | 6 | ||||
-rw-r--r-- | src/styleengine.cc | 4 | ||||
-rw-r--r-- | src/table.cc | 6 |
5 files changed, 23 insertions, 11 deletions
@@ -14,6 +14,7 @@ #include "prefs.h" #include "html_common.hh" #include "css.hh" +#include "cssparser.hh" using namespace dw::core::style; @@ -116,6 +117,17 @@ void CssContext::apply (CssPropertyList *props, Doctree *docTree, } CssStyleSheet * CssContext::buildUserAgentStyle () { + char *cssBuf = + "body {background: 0xdcd1ba; font-family: DejaVu Sans; color: black; margin-left: 5; \ + margin-top: 5; margin-bottom: 5; margin-right: 5; } \ + :link {color: blue; textdecoration: underline; cursor: pointer; } \ + :visited {color: green; textdecoration: underline; cursor: pointer; } \ + b, strong {fontweight: bolder; }"; + + a_Css_parse (this, cssBuf, strlen (cssBuf), 0, CSS_ORIGIN_USER_AGENT); + + + CssStyleSheet *s = new CssStyleSheet (); CssPropertyList *props; @@ -188,8 +200,7 @@ CssStyleSheet * CssContext::buildUserAgentStyle () { // <table> props = new CssPropertyList (); props->set (CssProperty::CSS_PROPERTY_BORDER_STYLE, BORDER_OUTSET); - props->set (CssProperty::CSS_PROPERTY_BORDER_SPACING_HORIZONTAL, 1); - props->set (CssProperty::CSS_PROPERTY_BORDER_SPACING_VERTICAL, 1); + props->set (CssProperty::CSS_PROPERTY_BORDER_SPACING, 1); s->addRule (new CssSelector(a_Html_tag_index("table")), props); // <td> @@ -28,8 +28,7 @@ class CssProperty { CSS_PROPERTY_BORDER_RIGHT_COLOR, CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_PROPERTY_BORDER_RIGHT_WIDTH, - CSS_PROPERTY_BORDER_SPACING_HORIZONTAL, - CSS_PROPERTY_BORDER_SPACING_VERTICAL, + CSS_PROPERTY_BORDER_SPACING, CSS_PROPERTY_BORDER_STYLE, CSS_PROPERTY_BORDER_TOP_COLOR, CSS_PROPERTY_BORDER_TOP_STYLE, diff --git a/src/cssparser.cc b/src/cssparser.cc index 1600d279..e21baca0 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -69,6 +69,7 @@ CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST] = { { "border-bottom-style", CSS_TYPE_ENUM, Css_border_style_enum_vals }, { "border-bottom-width", CSS_TYPE_LENGTH, NULL }, { "border-collapse", CSS_TYPE_UNUSED, NULL }, + { "border-color", CSS_TYPE_UNUSED, NULL }, { "border-left-color", CSS_TYPE_COLOR, NULL }, { "border-left-style", CSS_TYPE_ENUM, Css_border_style_enum_vals }, { "border-left-width", CSS_TYPE_LENGTH, NULL }, @@ -76,6 +77,7 @@ CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST] = { { "border-right-style", CSS_TYPE_ENUM, Css_border_style_enum_vals }, { "border-right-width", CSS_TYPE_LENGTH, NULL }, { "border-spacing", CSS_TYPE_LENGTH, NULL }, + { "border-style", CSS_TYPE_UNUSED, NULL }, { "border-top-color", CSS_TYPE_COLOR, NULL }, { "border-top-style", CSS_TYPE_ENUM, Css_border_style_enum_vals }, { "border-top-width", CSS_TYPE_LENGTH, NULL }, @@ -106,6 +108,7 @@ CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST] = { { "list-style-image", CSS_TYPE_UNUSED, NULL }, { "list-style-position", CSS_TYPE_UNUSED, NULL }, { "list-style-type", CSS_TYPE_ENUM, Css_list_style_type_enum_vals }, + { "margin", CSS_TYPE_UNUSED, NULL }, { "margin-bottom", CSS_TYPE_LENGTH, NULL }, { "margin-left", CSS_TYPE_LENGTH, NULL }, { "margin-right", CSS_TYPE_LENGTH, NULL }, @@ -120,6 +123,7 @@ CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST] = { { "outline-style", CSS_TYPE_UNUSED, NULL }, { "outline-width", CSS_TYPE_UNUSED, NULL }, { "overflow", CSS_TYPE_UNUSED, NULL }, + { "padding", CSS_TYPE_UNUSED, NULL }, { "padding-bottom", CSS_TYPE_LENGTH, NULL }, { "padding-left", CSS_TYPE_LENGTH, NULL }, { "padding-right", CSS_TYPE_LENGTH, NULL }, @@ -145,6 +149,8 @@ CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST] = { { "x-link", CSS_TYPE_INTEGER, NULL }, { "x-colspan", CSS_TYPE_INTEGER, NULL }, { "x-rowspan", CSS_TYPE_INTEGER, NULL }, + + { "last", CSS_TYPE_UNUSED, NULL }, }; #define CSS_SHORTHAND_NUM 14 diff --git a/src/styleengine.cc b/src/styleengine.cc index ca0bca64..50cd6570 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -126,10 +126,8 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) { case CssProperty::CSS_PROPERTY_BORDER_WIDTH: attrs->borderWidth.setVal (p->value.intVal); break; - case CssProperty::CSS_PROPERTY_BORDER_SPACING_HORIZONTAL: + case CssProperty::CSS_PROPERTY_BORDER_SPACING: attrs->hBorderSpacing = p->value.intVal; - break; - case CssProperty::CSS_PROPERTY_BORDER_SPACING_VERTICAL: attrs->vBorderSpacing = p->value.intVal; break; case CssProperty::CSS_PROPERTY_COLOR: diff --git a/src/table.cc b/src/table.cc index 3f4ddc69..1db32793 100644 --- a/src/table.cc +++ b/src/table.cc @@ -61,10 +61,8 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize) if (border != -1) props.set (CssProperty::CSS_PROPERTY_BORDER_WIDTH, border); - if (cellspacing != -1) { - props.set (CssProperty::CSS_PROPERTY_BORDER_SPACING_HORIZONTAL, cellspacing); - props.set (CssProperty::CSS_PROPERTY_BORDER_SPACING_VERTICAL, cellspacing); - } + if (cellspacing != -1) + props.set (CssProperty::CSS_PROPERTY_BORDER_SPACING, cellspacing); /* When dillo was started with the --debug-rendering option, there * is always a border around the table. */ |