W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > June 2010

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

From: Mark Birbeck <mark.birbeck@webbackplane.com>
Date: Sat, 12 Jun 2010 15:44:50 +0100
Message-ID: <AANLkTimtyKI58VgnbEnYAncmwx1z-5b-mr5dB-LcMVb5@mail.gmail.com>
To: RDFa WG <public-rdfa-wg@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:06 GMT