W3C home > Mailing lists > Public > www-style@w3.org > March 2013

[css3-text] Feature request: "white-space: ignore"

From: Zack Weinberg <zackw@panix.com>
Date: Tue, 18 Dec 2012 22:55:30 +0000
Message-ID: <CAKCAbMhHczYZVKu6EZ_aKpPA7f-pLxOnDq+Rbe5cnRNkBEN=BQ@mail.gmail.com>
To: www-style@w3.org
If the attached test case is viewed on a computer with both Arial and
Trebuchet MS installed, you should see that the boxes marked "label
one" and "box one" are on the same line, whereas the box marked "box
two" has been pushed onto a new line below "label two".  This is
because there is a whitespace node in between each pair of boxes
(which are 'inline-block') in the DOM, the second container is being
drawn with Trebuchet MS, and its space character is ever so slightly
too wide to fit in the gap left between the boxes.  (Identical
behavior observed with Firefox, Chrome, and IE9.  Safari and Opera
don't push "box two" onto a new line, perhaps because they round
things differently.)

The whitespace node comes from pretty-printing of the HTML source and
was not intended to be significant.  It would be nice if there were a
way to tell the renderer not to allocate any space for such
unintentional nodes.  A "white-space" value seems like the logical
place to put that way; I suggest "white-space:ignore".  There is a
slight awkwardness in that 'white-space' inherits, so it would be
necessary in this example to mark the inner divs as white-space:normal
explicitly, but I think we can probably live with that.


Received on Friday, 29 March 2013 13:04:57 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:09 UTC