Re: Flushing trailing text in document.write()

On Thu, 19 Mar 2009, Henri Sivonen wrote:
>
> While fixing an issue related to flushing elements so that gEBI can see 
> elements that were document.written immediately before the gEBI call, it 
> occurred to me to test the flushing of trailing text.
> 
> Demos:
> http://hsivonen.iki.fi/test/moz/flushing-document-written-text.html
> http://hsivonen.iki.fi/test/moz/flushing-document-written-text-no-alert.html
> 
> Firefox 3, WebKit trunk, Opera 10, IE8 (IE8 standards mode) and IE7 
> (standards mode) all flush the document.written element node to the DOM 
> before the gEBI.
> 
> WebKit and Opera don't flush the trailing text, a behavior that flows 
> naturally from an implementation that has a lazily flushed text 
> accumulation buffer in the tree builder.

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.)


> 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?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 26 April 2009 22:47:55 UTC