[CSS21] Missing whitespace processing step for 'nowrap'

Hi,

WeasyPrint 0.18 implements the 'white-space' processing model exactly as 
described in §16.6.1, but fails this test: (The text wraps and some red 
is visible.)

http://test.csswg.org/suites/css2.1/20110323/html4/blocks-018.htm

Indeed, at no point is §16.6.1 is 'nowrap' treated differently from 
'normal'. I think that a step is missing in the algorithm.

Proposed change: after step 4.2 quoted here:
> 2. any space (U+0020) following another space (U+0020) — even a space
> before the inline, if that space also has 'white-space' set to
> 'normal', 'nowrap' or 'pre-line' — is removed.

… add a new 4.3 step:
> 3. If 'white-space' is set to 'nowrap', any remaining space (U+0020)
> is treated as a non-breaking spaces.


This change matches the description of 'nowrap' in §16.6, and makes 
WeasyPrint pass the test.

-- 
Simon Sapin

Received on Thursday, 11 April 2013 16:36:23 UTC