- From: David Brownell <david-b@pacbell.net>
- Date: Mon, 04 Oct 1999 10:04:32 -0700
- To: Arnaud Le Hors <lehors@w3.org>
- Cc: www-dom@w3.org
Arnaud Le Hors wrote: > ... much good stuff, I'm happy with what I saw, and have some clarifications ... > David Brownell wrote: > > > > * I can't see how I'd write a chunk of code that'll know it > > can use Level 2 features ... e.g. it's portable and needs > > to work with both L1 and L2. > > I don't understand, the idea is that you'd write something like: > > if (DOMImplementation.hasFeature("XML", "2.0")) { > printOutElementWithNS(el); > } else { > printOutElement(el); > } Actually, I was more thinking along these lines, since in some cases (like XHTML) it wouldn't just be the XML DOM that code might be dealing with: if (DOMImplementation.hasFeature("XML", "2.0") || DOMImplementation.hasFeature("HTML", "2.0") ) { printOutElementWithNS(el); } else { printOutElement(el); } Workable but ugly. I have something against ugliness, so I'd prefer just to see a "feature" for the core itself ("DOM"); but clearly the ugly version would work too. > > I'd like to see a "DOM" feature (for DOMImplementation) be > > defined, which would report on which level is supported. > > Like what? Something like this: > > DOMString getFeature(DOMString feature) No, I was more thinking of a way to avoid the disjunction above. But the "getFeature" API could also be healthy. The thing I'd say against it is that it might encourage applications to do version checking wrong, even more than they must today due to nonconformant implementations. > * It's confusing to have feature definitions scattered all > > over the spec. > > > > I'd like to see them collected in one table at one place, so > > their overall scope is more readily understood. > > I'll see what I can do on that front. Thanks! Also, it might help to clarify dependencies between feature sets. For example, the "MouseEvents" feature requires "UIEvents", "Events", and also "Views". (And for that matter, the L1 "HTML" feature requires some sort of parser and user interface integration.) - Dave
Received on Monday, 4 October 1999 13:05:43 UTC