changeset 754:336ae7ab06a8

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.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 12 Jan 2009 18:12:33 +0100
parents 8d0cce1b9129
children bad0f47c6758 4a195f273396 df8153796f48
files src/css.cc src/html.cc
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/css.cc	Mon Jan 12 13:23:52 2009 +0100
+++ b/src/css.cc	Mon Jan 12 18:12:33 2009 +0100
@@ -304,6 +304,7 @@
      "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}"
--- a/src/html.cc	Mon Jan 12 13:23:52 2009 +0100
+++ b/src/html.cc	Mon Jan 12 18:12:33 2009 +0100
@@ -2552,11 +2552,11 @@
    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 */