Re: <details>

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