aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-12 18:12:33 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-12 18:12:33 +0100
commit1b38c3eeac1bb16030323cb68859adb00bf98004 (patch)
tree99b24f50a466727aed8cd988644617916df8099b /src
parent94ab2a15690ac844e964f10e9e16caf8a9d68078 (diff)
replace fixed break space in Html_tag_open_li() with a user agent style
This changes allows to set the margin of <li> elements to zero via CSS. Subsequent <li> elements then have no spacing in between. Test case: <html> <head> <style type="text/css"> li { border: 1px solid black; margin: 0; } </style> </head> <body> <ul> <li>hello</li> <li>hello</li> </ul> </body> </html> There should be no vertical space between the two boxes.
Diffstat (limited to 'src')
-rw-r--r--src/css.cc1
-rw-r--r--src/html.cc4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/css.cc b/src/css.cc
index 578ccfb7..2b069f18 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -304,6 +304,7 @@ void CssContext::buildUserAgentStyle () {
"h5 {font-size: 0.83em; margin-top: 1.5em; margin-bottom: 0}"
"h6 {font-size: 0.75em; margin-top: 1.67em; margin-bottom: 0}"
"hr {width: 100%; border: 1px inset}"
+ "li {margin-top: 0.1em}"
"pre {white-space: pre}"
"ol {list-style-type: decimal}"
"ul {list-style-type: disc}"
diff --git a/src/html.cc b/src/html.cc
index 2c348fc8..06fcee4f 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -2552,11 +2552,11 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize)
list_number = &html->stack->getRef(html->stack->size()-2)->list_number;
ref_list_item = &html->stack->getRef(html->stack->size()-2)->ref_list_item;
- DW2TB(html->dw)->addParbreak (2, wordStyle);
+ DW2TB(html->dw)->addParbreak (0, wordStyle);
list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width);
DW2TB(html->dw)->addWidget (list_item, style);
- DW2TB(html->dw)->addParbreak (2, wordStyle);
+ DW2TB(html->dw)->addParbreak (0, wordStyle);
*ref_list_item = list_item;
S_TOP(html)->textblock = html->dw = list_item;
/* Handle it when the user clicks on a link */