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

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">
  <div>
    <span>abc</span>
    <span>def</span>
  </div>
<body>
---

When I emulated the white-space-collapse algorithm using JavaScript, the
document tree turned into:
---
<body>&#x200c;<div>&#x200c;<span>abc</span>&#x200c;<span>def</span>&#x200c;</div>&#x200c;</body>
---

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

but instead I'm seeing an extra line break before and after "abcdef":
---
(empty line)
abcdef
(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
---

Thanks.
Jon Ferraiolo,
IBM Distinguished Engineer
Director OpenAjax Alliance

Received on Saturday, 30 October 2010 00:45:23 UTC