From f546f6b5e739657c163b38e46d16c913a4c9cddd Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 5 Nov 2006 19:50:34 +0000 Subject: Implement list-style-type circle, square, none, and decimal. svn path=/trunk/netsurf/; revision=3034 --- render/box_construct.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index 1245ed800..b6806c106 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -416,8 +416,42 @@ bool box_construct_element(xmlNode *n, struct content *content, return false; marker->type = BOX_BLOCK; /** \todo marker content (list-style-type) */ - marker->text = "\342\200\242"; - marker->length = 3; + switch (style->list_style_type) { + case CSS_LIST_STYLE_TYPE_DISC: + default: + /* 2022 BULLET */ + marker->text = "\342\200\242"; + marker->length = 3; + break; + case CSS_LIST_STYLE_TYPE_CIRCLE: + /* 2742 CIRCLED OPEN CENTRE EIGHT POINTED STAR*/ + marker->text = "\342\235\202"; + marker->length = 3; + break; + case CSS_LIST_STYLE_TYPE_SQUARE: + /* 25A0 BLACK SQUARE */ + marker->text = "\342\226\240"; + marker->length = 3; + break; + case CSS_LIST_STYLE_TYPE_DECIMAL: + case CSS_LIST_STYLE_TYPE_LOWER_ALPHA: + case CSS_LIST_STYLE_TYPE_LOWER_ROMAN: + case CSS_LIST_STYLE_TYPE_UPPER_ALPHA: + case CSS_LIST_STYLE_TYPE_UPPER_ROMAN: + if (parent->last && parent->last->list_marker) + marker->rows = parent->last-> + list_marker->rows + 1; + marker->text = talloc_array(content, char, 20); + if (!marker->text) + return false; + snprintf(marker->text, 20, "%u.", marker->rows); + marker->length = strlen(marker->text); + break; + case CSS_LIST_STYLE_TYPE_NONE: + marker->text = 0; + marker->length = 0; + break; + } if (style->list_style_image.type == CSS_LIST_STYLE_IMAGE_URI) { if (!html_fetch_object(content, -- cgit v1.2.3