Re: [css21] parsing of comment and element nodes inside style declaration

/Ian Hickson/:
> On Sun, 16 Oct 2005, Stanimir Stamenkov wrote:
>
>> That's somewhat incompatible with the DOM Level 3 'Node.textContent' 
>> property. Is there a specific reason for this specification (WHATWG's 
>> WA1) not considering the text items/nodes which are not direct children 
>> of the 'style' element?
> 
> It's (much) faster to crawl just the direct text children than to crawl 
> the entire tree. Since this is error handling behaviour, there is little 
> reason to go any way other than efficiency in this case.

I wonder how much faster it would be if the data is processed from a 
stream and the tree is going to be crawled anyway, at least to 
detect the well-formed end of the 'style' element (I didn't 
understand the "error handling behavior" part), or you point the 
text content for the style sheet is processed only from already 
built DOM nodes?

IMO, the 'textContent' property being property implies (to some 
possible extent) the DOM implementation would optimize the storage 
of the represented value, to be retrieved directly and not as part 
of some computation (and possible allocation of new resources in 
this case, concatenating the values of text nodes).

-- 
Stanimir

Received on Monday, 17 October 2005 18:37:05 UTC