summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-12-08 18:41:23 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-12-08 18:41:23 +0100
commit8c95d423cee2fc3a1666f938c8b7bbcbd0355cbc (patch)
treeaddf91332aa71fbe4f93cae995e15b2c784189fa
parentdd1fe82d94986ca9aea49c803304ca9355cdcbf2 (diff)
add support for CSS property list-style-position
-rw-r--r--ChangeLog1
-rw-r--r--dw/listitem.cc6
-rw-r--r--dw/style.cc4
-rw-r--r--dw/style.hh5
-rw-r--r--src/cssparser.cc7
-rw-r--r--src/styleengine.cc3
6 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 485b867e..c6a6dfa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ dillo-2.2 [??]
- Ignore XML comment markers in CSS.
- Split up long lines in plain.cc to avoid X11 coordinate overflows.
- Fix user agent style for nested <ul>.
+ - Add support for CSS property list-style-position.
Patch: Johannes Hofmann
+- Cleaned up system includes in dpid directory.
- Fixed CustProgressBox() for systems without weak symbols.
diff --git a/dw/listitem.cc b/dw/listitem.cc
index 02a91eb7..ed7a2c75 100644
--- a/dw/listitem.cc
+++ b/dw/listitem.cc
@@ -43,7 +43,8 @@ void ListItem::initWithWidget (core::Widget *widget,
hasListitemValue = true;
addWidget (widget, style);
addSpace (style);
- updateValue ();
+ if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE)
+ updateValue ();
}
void ListItem::initWithText (const char *text, core::style::Style *style)
@@ -51,7 +52,8 @@ void ListItem::initWithText (const char *text, core::style::Style *style)
hasListitemValue = true;
addText (text, style);
addSpace (style);
- updateValue ();
+ if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE)
+ updateValue ();
}
int ListItem::getValue ()
diff --git a/dw/style.cc b/dw/style.cc
index d28d1389..6368560f 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -41,6 +41,7 @@ void StyleAttrs::initValues ()
textDecoration = TEXT_DECORATION_NONE;
textAlign = TEXT_ALIGN_LEFT;
textAlignChar = '.';
+ listStylePosition = LIST_STYLE_POSITION_OUTSIDE;
listStyleType = LIST_STYLE_TYPE_DISC;
valign = VALIGN_BASELINE;
backgroundColor = NULL;
@@ -131,6 +132,7 @@ bool StyleAttrs::equals (object::Object *other) {
borderStyle.left == otherAttrs->borderStyle.left &&
display == otherAttrs->display &&
whiteSpace == otherAttrs->whiteSpace &&
+ listStylePosition == otherAttrs->listStylePosition &&
listStyleType == otherAttrs->listStyleType &&
x_link == otherAttrs->x_link &&
x_img == otherAttrs->x_img &&
@@ -162,6 +164,7 @@ int StyleAttrs::hashValue () {
borderStyle.left +
display +
whiteSpace +
+ listStylePosition +
listStyleType +
x_link +
x_img +
@@ -240,6 +243,7 @@ void Style::copyAttrs (StyleAttrs *attrs)
borderStyle = attrs->borderStyle;
display = attrs->display;
whiteSpace = attrs->whiteSpace;
+ listStylePosition = attrs->listStylePosition;
listStyleType = attrs->listStyleType;
cursor = attrs->cursor;
x_link = attrs->x_link;
diff --git a/dw/style.hh b/dw/style.hh
index af6642f9..33be512d 100644
--- a/dw/style.hh
+++ b/dw/style.hh
@@ -256,6 +256,10 @@ enum DisplayType {
DISPLAY_LAST
};
+enum ListStylePosition {
+ LIST_STYLE_POSITION_INSIDE,
+ LIST_STYLE_POSITION_OUTSIDE
+};
enum ListStyleType {
LIST_STYLE_TYPE_DISC,
@@ -427,6 +431,7 @@ public:
DisplayType display;
WhiteSpace whiteSpace;
+ ListStylePosition listStylePosition;
ListStyleType listStyleType;
Cursor cursor;
diff --git a/src/cssparser.cc b/src/cssparser.cc
index 39b43c1f..d0daf566 100644
--- a/src/cssparser.cc
+++ b/src/cssparser.cc
@@ -81,6 +81,10 @@ static const char *const Css_letter_spacing_enum_vals[] = {
"normal", NULL
};
+static const char *const Css_list_style_position_enum_vals[] = {
+ "inside", "outside", NULL
+};
+
static const char *const Css_list_style_type_enum_vals[] = {
"disc", "circle", "square", "decimal", "decimal-leading-zero",
"lower-roman", "upper-roman", "lower-greek", "lower-alpha",
@@ -157,7 +161,8 @@ const CssPropertyInfo Css_property_info[CSS_PROPERTY_LAST] = {
Css_letter_spacing_enum_vals},
{"line-height", {CSS_TYPE_UNUSED}, NULL},
{"list-style-image", {CSS_TYPE_UNUSED}, NULL},
- {"list-style-position", {CSS_TYPE_UNUSED}, NULL},
+ {"list-style-position", {CSS_TYPE_ENUM, CSS_TYPE_UNUSED},
+ Css_list_style_position_enum_vals},
{"list-style-type", {CSS_TYPE_ENUM, CSS_TYPE_UNUSED},
Css_list_style_type_enum_vals},
{"margin-bottom", {CSS_TYPE_SIGNED_LENGTH, CSS_TYPE_UNUSED}, NULL},
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 5472f3b6..c5d44906 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -414,6 +414,9 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
case CSS_PROPERTY_DISPLAY:
attrs->display = (DisplayType) p->value.intVal;
break;
+ case CSS_PROPERTY_LIST_STYLE_POSITION:
+ attrs->listStylePosition = (ListStylePosition) p->value.intVal;
+ break;
case CSS_PROPERTY_LIST_STYLE_TYPE:
attrs->listStyleType = (ListStyleType) p->value.intVal;
break;