- From: Jim Ley <jim@jibbering.com>
- Date: Thu, 23 Mar 2006 02:17:20 -0000
- To: "Web APIs WG \(public\)" <public-webapi@w3.org>
"Maciej Stachowiak" <mjs@apple.com> > 1) I think it's really useful to have these names be short. Short but impossible to tell what they actually do - I have no idea that match has anything to do with CSS - indeed I have little understanding of why CSS syntax has suddenly become Selectors, it's unclear, it's imprecise and it's confusing. Brevity is irrelevant. > The fact that one of the most common operations you do by the dom is > called document.getElementById is a huge disaster. I think you need some evidence to back up this "huge disaster", it's very well used, and very well known, and it is extremely clear what it does, for me it's one of the few sucessful parts of the DOM. > Use case for matching one is to be able to easily operate on the first > item when you know you have a unique match: > > document.match("#header").addEventListener("click", headerClick, false); This is unsafe, and completely not a use case, please use examples that are actually reasonable (ie not ones that are already met by existing technology. Please provide a use case - ie a reasonable example expression where there's only going to be 1 result (and no more and no less in the above example), if you mean it's an author optimisation, then author is equally likely to know if there are 4 or more results, so the optimisation of a limit is exactly the way to go, rather than just 1, it also simplifies the DOM as there's only one method. > document.match("iframe[name='ad-banner']").addEventListener("click", > bannerClick, false); Another poor example already met by existing implemented APIs. Please provide example use cases for this single match optimisation. > I don't think the case of "first n for some arbitrary value of n" is > common enough to be worth adding API for. I'm not convinced the singular is either, indeed the author optimisation use case of knowing the number is a use case I can see. DOM's are slow enough as it is. >> Mainly these names say nothing about their inescapable link to >> Selectors, they should. > > Unfortunately the name document.selectNodes is taken by XPath, and > select() would be easily confused with document.selection. I don't regard either of those as acceptable meaningful names either. Jim.
Received on Thursday, 23 March 2006 02:19:06 UTC