Re: Flushing trailing text in document.write()

On Apr 26, 2009, at 15:47, Ian Hickson wrote:

> It's possible to have a text accumulation buffer in the tree builder
> without needing to flush it; just use the current text node's own  
> buffer.
> (I believe this gets you the Firefox behaviour pretty cheaply.)

But you want IE behavior, not Firefox behavior. :-)

Also, using the node's buffer leads to a conflict between buffer  
growth strategies that make minimize branches and reallocs for a tree  
builder buffer and strategies that keep the memory footprint of the  
DOM nodes compact.

>> In any case, the implementation requirements aren't obvious from the
>> spec text. Even if the specced behavior stays as is, it would be  
>> good to
>> draw attention to the implications in this case.
>
> Could you elaborate on how it's not obvious?

The interactions of various rules aren't obvious, because I  
misunderstood the spec. :-) I've been developing software according to  
the parsing section for a whine now, and the design I came up with  
independently matched the WebKit/Opera design, because I didn't  
realize you had actually written spec text that taken as a whole has  
enough constraints to happen to mean the IE behavior. (When starting  
this thread, I thought the spec wanted the Firefox behavior.) Please  
call out the implications in this case explicitly using examples. (On  
IRC, it wasn't even obvious to you that the Firefox and IE behaviors  
were distinct.)

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 29 April 2009 16:29:27 UTC