kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

List item indention comes from wrong style attribute #299

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
1. Open the attached HTML file.

What is the expected output? What do you see instead?
Expected: The list items have an indention of 12px.
Actual: The list items have an indention of 52px.

Which version of the product are you using?
svn revision 432.

Additional information:
The difference between HtmlViewer and other browsers is that HtmlViewer uses 
the LI-Tag's margin-left for the indention whereas other browsers use the 
UL-Tag's padding-left for the indention.

Original issue reported on code.google.com by Andreas....@gmail.com on 28 Aug 2013 at 2:10

Attachments:

GoogleCodeExporter commented 9 years ago
Andreas, 

thanks for this hint. I'm willing to apply the patch, but the default css 
script of CSS 2.1 in http://www.w3.org/TR/CSS21/sample.html uses margin-left to 
indent lists by 40px. 

As written there the script is not a specification but a collection of 
researched currenct practice.

Did you find out that preferably padding-left is used?

Thanks again
OrphanCat

Original comment by OrphanCat on 2 Sep 2013 at 5:38

GoogleCodeExporter commented 9 years ago
If you remove the "margin: 0px; margin-left: 12px;" from the attached 
ul_ident_test.html file you see that Chrome, Firefox and IE10 use the padding 
and not the margins. And if you instead remove the "padding: 0px" you see that 
the 40px (plus the 12px from margin-left) are used.

I observed this "mis-behavior" after switching from EmbeddedWB to HtmlViewer 
where all the ul-Tags suddenly had a much larger indention.

Original comment by Andreas....@gmail.com on 2 Sep 2013 at 6:09

GoogleCodeExporter commented 9 years ago
Thanks for clarification.

r435 fixes this issue.

Original comment by OrphanCat on 4 Sep 2013 at 6:55

GoogleCodeExporter commented 9 years ago

Original comment by OrphanCat on 4 Sep 2013 at 6:55

GoogleCodeExporter commented 9 years ago
> I'm willing to apply the patch, but the default css script of CSS 2.1 in 
> http://www.w3.org/TR/CSS21/sample.html uses margin-left to indent lists by 
40px.
FWIW the main browsers already match the HTML5 rendering defaults[1], which 
list a left padding of 40px as default. I attached two screenshots of Chrome 
and Firefox for illustration.
Furthermore browsers fall into Quirks Mode when no doctype is given[2] like in 
the test case, which at least in Firefox[3] is HTML5 conform.

Sebastian

[1] http://www.w3.org/TR/html5/rendering.html#lists
[2] http://en.wikipedia.org/wiki/Quirks_mode#Comparison_of_document_types
[3] https://developer.mozilla.org/en-US/docs/Mozilla_Quirks_Mode_Behavior

Original comment by sebastia...@gmail.com on 5 Sep 2013 at 6:16

Attachments: