[whatwg] getElementsByIdPart

Doron Rosenberg doronr at gmail.com
Sun Aug 29 17:49:49 PDT 2004


On Sun, 29 Aug 2004 09:47:57 +0100, Jim Ley <jim.ley at gmail.com> wrote:
> On Sat, 28 Aug 2004 20:23:38 -0500, Doron Rosenberg <doronr at gmail.com> wrote:
> > People keep asking about getElementsBy{Something}, so having a
> > getElementsByAttribute (I believe Mozilla's XBL impl has a similar
> > beast) would cover all those requests.
> 
> The problem with getElementsByAttribute is that it doesn't help with
> ByClassName etc. - the various CSS selection methods people are asking
> for, because it needs to act on part of the attribute, not the whole
> one.  (by idPart is imo completely wrong, Classes are the correct way
> in HTML to group elements into common things)
> 
> I personally think simple DOM XPath would also address that - I
> realise Opera currently feels this is impractical on mobile because it
> would make the codebase larger than current, but other people have
> started to show very small (if not fast) implementations of XPath, and
> I don't think it would be unreasonable to for now just say do XPath,
> then after implementation feedback, if it's proven to be a problem, to
> look at simpler methods like these.
> 
> Especially as other browser technologies will likely be requiring DOM
> XPath, the vendors are likely going to have to implement it anyway,
> and if that's the case, all we're doing is duplicating the amount of
> methods that do almost identical things.
> 
> Jim.
> 

Good point.  XPath usually can be optimized (making the path as
specific as possible), and it seems Safari is adding XSLT, so this
means that IE/Gecko/Khtml will support XPath.  If Opera supports DOM
traversal (not sure if it does), you have 100% of the browser engines
:)



More information about the whatwg mailing list