[whatwg] 2.2.1. DOM feature strings
ian at hixie.ch
Thu May 24 13:52:00 PDT 2007
On Mon, 7 Nov 2005, ROBO Design wrote:
> I have read 2.2.1. DOM feature strings  and I have the following
> > User agents should respond with a true value when the hasFeature
> > method is queried with these values.
> Why the word "should" is being used? This allows implementors to simply
> not implement this, therefore not providing authors a way to check for
> HTML 5 support (WA 1.0).
It's a "should" because in some cases, e.g. experimental or incomplete
implementations, the UA implementor would want to specifically return
false so as to not make this mechanism useless.
> b) The feature string "XHTML" combined with version string "5.0" is to
> me not very inspired. Simple reason: XHTML 2. What if they get to XHTML
> 5? In my opinion, checking for XHTML 5.0 should *not* be available.
Are you still worried about this?
> c) hasFeature("WA", "1.0") should be also available, because the
> specification defines Web Applications 1.0 (aka HTML 5).
The specification has now been renamed to HTML 5.
> > d) in general, therefore, use of this method is discouraged.
> How are authors supposed to check for WA 1.0 support in the user agent?
Depends on the feature. But typically, as you say:
> I am also aware developers are supposed to check for the existence of
> each property/method before using it.
That's the preferred method.
> I'd like this to be available, because as a web developer I'm interested
> to check in general if the user agent supposes it has support for WA
> 1.0. When I want to do a general check I wouldn't like to write a huge
> script which checks the availability of each of the WA 1.0 DOM stuff I
You can check the feature string, that's why it's there. But it won't tell
you much. Browsers don't support HTML5 or not support HTML5. They support
bits of it. For example all browsers support <div>. But no browsers today
support <datagrid>. What should today's browsers do when queried about
whether they support HTML5 in hasFeature?
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg