W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: <details>

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 15 Sep 2009 13:55:32 +0200
Message-ID: <4AAF80B4.9010708@lachy.id.au>
To: Toby Inkster <tai@g5n.co.uk>
Cc: HTMLWG WG <public-html@w3.org>
Toby Inkster wrote:
> On Tue, 2009-09-15 at 11:09 +0000, Ian Hickson wrote:
>> Search for "unreliable" in:
>>     http://lists.w3.org/Archives/Public/public-html/2009Jul/0685.html
>
> hasFeature was unreliable because the features were too broad. Asking
> for a boolean answer to hasFeature('StyleSheets') is clearly not going
> to give you a useful answer.
>
> Asking for a boolean answer to implements("elements#details") is a
> different matter though. To claim that it's the same thing is a false
> comparison.

That's still quite broad.  Consider elements that has a lot more 
features to it than details does, like video and audio.  For example, 
what if a browser supports the APIs to play, pause and seek, but still 
doesn't support the APIs for, say, volume control.  Should the feature 
check evaluate to true or false?

> Do you really expect that any browsers will be released with *partial
> implementations* of the<details>  element? Implementations may be buggy,
> but they're pretty likely to be complete.

Given how relatively trivial details is, no, I wouldn't expect a browser 
to ship with a partial implementation of it.  But there are elements 
that are a lot more complicated which are very likely to have browsers 
ship with partial implementations.  That happens all the time.

> And even in the case where a browser does implement partial support for
> <details>  - say, it exposes the element's DOM, but don't offer a way of
> expanding and contracting the element - then how does the suggested
> alternative:
>
> if (typeof document.createElement('details').open == 'undefined') {
>     // script that implements<details>  here
> }
>
> improve matters? The meat of the script will not be executed.

It allows scripts to check for the specific features they need when they 
need them, rather than simply an all or nothing check.

> Using<script implements>  provides us with a neat, consistent and
> readable syntax. People seeing the code above would naturally ask
> themselves what is being opened.<script implements>  is simple and
> declarative. People seeing<script implements="element#details">  can
> say: oh, OK, this script implements the element<details>.

Your proposal and suggestion for how to use it seem to be conflicting. 
You seem to be proposing that if the attribute evaluates to true.  i.e. 
<script implements="elements#details"> is supposed to check if the 
details element is implemented, and then executes the script if it 
evaluates to true.

But given your example from your previous mail:

     <script implements="http://www.w3.org/1999/xhtml/element#details">
       // script to implement <details> goes here.
     </script>

That seems to be intended as a fallback for browsers that don't 
implement the feature, and thus intended to execute when the expression 
evaluates to false.

It would help if you were more clear about what problem you are trying 
to solve and could clearly explain how you think whatever solution 
you're proposing will solve it.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Tuesday, 15 September 2009 11:56:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:08 UTC