[webkit-dev] drawing LF/CR/etc.

Maciej Stachowiak mjs at apple.com
Tue Jun 13 11:40:17 PDT 2006

On Jun 13, 2006, at 11:31 AM, Darin Adler wrote:

> On Jun 13, 2006, at 8:59 AM, Mike Reed wrote:
>> ...
>> <input type="checkbox" name="box" checked="checked" />Test
>> <input ...>
>> ...
>> When I draw this page, I see a box at the end of "Test". "Test" is
>> comming into Font::drawText() as a 5 character string, with a CR (or
>> LF, don't remember which) at the end. In my font, that draws as a  
>> box.
>> Is it correct that the parser didn't strip that, or convert it into a
>> space?
> Yes. The parser must not convert it to a space; the DOM must  
> contain a space.

Darin meant "the DOM must contain a newline, not a space". To be more  
specific, because whitespace mode can be controlled with CSS and  
indeed can even be changed on the fly, the DOM must always preserve  
teh original characters with no outspace processing.

> Here's the rule, taken from the code in GlyphMap.cpp (now cross- 
> platform on TOT, formerly Macintosh-specific code) that implements  
> the rule for the fast code path:
>     Control characters (U+0000 - U+0020, U+007F - U+00A0) must not  
> render at all.
>     \n (U+000A), \t (U+0009), and non-breaking space (U+0020) must  
> render as a space.

That sounds wrong for tabs...

  - Maciej

More information about the webkit-dev mailing list