summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2006-11-05 19:50:34 +0000
committerJames Bursa <james@netsurf-browser.org>2006-11-05 19:50:34 +0000
commitf546f6b5e739657c163b38e46d16c913a4c9cddd (patch)
treeb0483e8d17480ecfd3ba663af76664d2cebe6529
parentfc197a48352dd0d520ca752b5a32a0850930ea6f (diff)
downloadnetsurf-f546f6b5e739657c163b38e46d16c913a4c9cddd.tar.gz
netsurf-f546f6b5e739657c163b38e46d16c913a4c9cddd.tar.bz2
Implement list-style-type circle, square, none, and decimal.
svn path=/trunk/netsurf/; revision=3034
-rw-r--r--!NetSurf/Resources/CSS,f796
-rw-r--r--render/box_construct.c38
2 files changed, 40 insertions, 4 deletions
diff --git a/!NetSurf/Resources/CSS,f79 b/!NetSurf/Resources/CSS,f79
index 6124e6b34..103634294 100644
--- a/!NetSurf/Resources/CSS,f79
+++ b/!NetSurf/Resources/CSS,f79
@@ -53,8 +53,10 @@ pre { display: block; font-family: monospace; white-space: pre; margin-bottom: 1
ins { color: green; text-decoration: underline; }
del { color: red; text-decoration: line-through; }
-ul { display: block; padding-left: 0.5em; margin-bottom: 1em; }
-ol { display: block; padding-left: 0.5em; margin-bottom: 1em; }
+ul { display: block; padding-left: 1.5em; margin-bottom: 1em;
+ list-style-type: disc; }
+ol { display: block; padding-left: 1.5em; margin-bottom: 1em;
+ list-style-type: decimal; }
li { display: list-item; padding-left: 0.5em; margin-bottom: 0.3em; }
dl { display: block; padding-left: 0.5em; margin-bottom: 1em; }
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,