Re: HTML Extensibility Through Script

Hi, Jon-

Jon Barnett wrote:
> On 7/10/07, Doug Schepers <> wrote:
>> This seems to have drifted off-topic rather quickly... To refocus, I
>> wasn't asking for a way to sniff browser strings, which is a brittle way
>> to determine the featureset of the UA.  I intended this thread to
>> discuss the possibility of conditional operators, either through a
>> script API or (preferably) via a declarative markup or featurestring.
> Is there a use case that isn't covered by DOMImplementation.hasFeature()?

Possibly not.  Honestly, I hadn't considered "hasFeature()" for this, 
though I agree it does fit the bill for the scripted API, assuming that 
it is properly supported (see below).

I still think that a declarative 'switch' feature or the like is a 
better choice, more generic, more powerful than a simple fallback 
mechanism, and doesn't rely on scripting (which in this case is not 
important, but...).

> For example, is there a UA that would render MathML, and support scripting,
> but not respond correctly to .hasFeature("org.w3c.dom.mathml", null); ?

Yes, Firefox 2.0.  It does support XHTML+MathML, but mysteriously claims 
not to [1].  In this case, for the sake of providing scripted 
implementation extensions/fallbacks, this is as bad as not supporting it 
in the first place, and possibly even worse, because the results will 
now be unpredictable.

Of course, .hasFeature is not perfect under the best of circumstances... 
if the implementation has only partial support, or flawed support, then 
it's unclear how it should reply.  SVG partly solves this by having lots 
of featurestrings, but it doesn't account for flawed support.

I'll keep trying to come up with a better solution, but it's a hard problem.


-Doug Schepers
W3C Staff Contact, SVG, CDF, and WebAPI

Received on Friday, 13 July 2007 21:51:35 UTC