[rdfaapi] Some clarifications on hasFeature() and the feature string

Following the general pattern of DOM-related APIs at the W3C, the RDFa
API supports the hasFeature() method to determine whether API support
is available:

  <http://www.w3.org/TR/2010/WD-rdfa-api-20100608/#widl-Document-hasFeature>

A few things on this section:

1. The hasFeature() is listed as if it's an RDFa API extension, when
actually it's a method provided by the existing DOM. All we're saying
is that if RDFa API support is provided by a DOM then it should
indicate this via the pre-existing hasFeature() method. A good
prototype of how this can be written is in the DOM 2 Core, at the top
of the 'Fundamental Interfaces' section:

  <http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-BBACDC08>

(Note also that the hasFeature() method is part of the
DOMImplementation interface, not the Document interface. It just
happens that browsers place the DOMImplementation interface onto the
document object.)


2. The spec says that the feature string provided as a parameter
should be "rdfa 1.1", i.e., the following should hold:

  assert.isTrue(document.hasFeature("rdfa 1.1"));

However, hasFeature() is defined such that the feature and version
number are two parameters. So what we really need is this:

  assert.isTrue(document.hasFeature("rdfa", "1.1"));


3. The second parameter to hasFeature() is optional, so this should
also be true:

  assert.isTrue(document.hasFeature("rdfa"));


4. And finally, I think most people would interpret the version number
as implying support for RDFa Core 1.1, rather than the RDFa API. I
think this is ok, but it also means that we need to allow for 1.0
support, for backwards compatibility. Therefore, I would suggest that
the following assertion should also be true:

  assert.isTrue(document.hasFeature("rdfa", "1.0"));

Regards,

Mark

--
Mark Birbeck, webBackplane

mark.birbeck@webBackplane.com

http://webBackplane.com/mark-birbeck

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

Received on Saturday, 12 June 2010 14:45:26 UTC