W3C home > Mailing lists > Public > www-style@w3.org > October 2010

white-space-collapse:discard - doesn't work for me

From: Jon Ferraiolo <jferrai@us.ibm.com>
Date: Fri, 29 Oct 2010 17:44:39 -0700
To: www-style@w3.org
Message-ID: <OFD95828DD.FDBFE3A9-ON882577CC.0002E684-882577CC.00041685@us.ibm.com>

The white-space-collapse:discard algorithm says that all consecutive white
space characters get converted into a zero width non-joiner (U+200C)
character. When I tried to emulate this behavior in Firefox and Chrome, I
do not get the results I expected.

Here is my HTML and CSS:
<body style="white-space-collapse:discard">

When I emulated the white-space-collapse algorithm using JavaScript, the
document tree turned into:

Since I said "discard", what I was hoping to see on my screen was:

but instead I'm seeing an extra line break before and after "abcdef":
(empty line)
(empty line)

Is this the expected result from the white-space-collapse:discard
algorithm? If so, then maybe there need to be another option on
white-space-collapse, something like a
"discard-everything-I-really-mean-it". :-)

Note that normal browser rendering (without white-space-collapse
processing) would not include the extra lines:
abc def

Jon Ferraiolo,
IBM Distinguished Engineer
Director OpenAjax Alliance
Received on Saturday, 30 October 2010 00:45:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:43 UTC