Previous Message
Next Message

Safari renders extra whitespace in ordered list

Sent by Colin Stein on 11 February 2005 00:12


I have noticed when I'm working with XHTML and Safari 1.2.4 on Mac OS X 
10.3.8 (and previous versions) that Safari will not, in some cases, 
compact the whitespace between tags when the document is served with an 
application/xhtml+xml MIME-type.  The extra whitespace are causing no 
end of trouble when I try to position things with CSS.   I have created 
a minimal demonstration of this issue here:

http://evn.beastiebox.com/tmp/safarilist/index.php?xhtml=yes

The behavior I expect to see is the same as when the document is served 
as text/html shown here:

http://evn.beastiebox.com/tmp/safarilist/index.php

In this example the far-right list item is pushed down by 1em because 
the tab-spaces used to indent the lines are being rendered as single 
spaces above it.  You can see them if you start selecting text at the 
end of the right-most list-item and working your way left (strangely, 
you can only select them as a "word" not individually).

I have found similar issues using nested <divs> in this fashion.  I 
have also noticed that the whitespace responds to the font-size: 
property set on the containing element (in this case a <ul>)

Firefox 1.0 on Mac OS X and Window, as well as Opera 7.54 on Mac OS X 
do not display this issue.  This problem does not appear when the same 
document is served as text/html. Stripping CSS from the document 
completely seems to make the problem disappear but I can't think of a 
good way to verify that observation.

I have tried searching the bug reports for Safari on quirksmode, 
browsing over the CSS discuss wiki, and googling for phases like 
"Safari XHTML whitespace" but have not found any mention of this. My 
understanding is that whitespace between tags should be compacted into 
a single character and that tabs count as regular white space.  Is this 
correct?  Assuming that whitespace between <ul> and <li> tags should 
not be displayed is there a way to make Safari behave more like Opera 
and Firefox without either stripping the tabs from the XHTML or 
changing the MIME-type?
___________
Colin Stein

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message