Re: Clarification on "live NodeList"

Andrew Fedoniouk wrote:
> I am not sure I understand how you would return the same instance
> of NodeList for different elements that were used to invoke 
> getElementsByName() with.

Oh, for different elements, sure.  But then they would be observing 
mutations in different parts of the document, too...

In any case, from what I've seen calling getElementsByTagName (which I 
assume you meant, since getElementsByName only exists on documents) on 
elements is a rare case.

> To be honest that reasoning sounds like "to be compatible with design 
> flaws of our forefathers".

No, it's "to be compatible with existings scripts that assume this 
behavior".

> The road to programmer's hell is paved by "bug compatibility patches".

And the road to XHTML2 is paved with the alternative in this case.

> I think Web technology already got enough of those and you probably one of the best persons who know
> this.

I'm all in favor of removing any bugwards compatibility content doesn't 
depend on....

> In any case HTML5 highnesses decided to deprecate <font> and <frameset>.
> Even deprecation will break the Web as there are no alternatives to
> <frameset> splitter behavior.

Deprecation doesn't mean that UAs stop implementing it.  So that has 
nothing to do with the thing we're discussing here.

> Back to the problem: I do not see what would be a problem to declare
>  getElementsByClassName() & friends as returning something like
> StaticNodeList (: public NodeList) as one wise person put here:
> 
> http://dev.w3.org/2006/webapi/selectors-api/draft/selectors-api.htm#staticnodelist 

It'd break existing pages.  So it's a non-starter.

-Boris

Received on Wednesday, 8 July 2009 07:15:38 UTC