W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: Thoughts on implementing the HTML5 <details> element with pure CSS

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 7 Apr 2010 07:16:32 -0700
Cc: "Andrew Fedoniouk" <news@terrainformatica.com>, "Maciej Stachowiak" <mjs@apple.com>, "www-style CSS" <www-style@w3.org>
Message-Id: <77306A22-622A-4907-955A-F4A92AD35CE3@gmail.com>
To: "Anne van Kesteren" <annevk@opera.com>

On Apr 7, 2010, at 7:13 AM, Anne van Kesteren wrote:

> On Wed, 07 Apr 2010 16:07:03 +0200, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Apr 7, 2010, at 12:16 AM, Andrew Fedoniouk wrote:
>> 
>>> Below is "pure" CSS solution of such expanding/collapsing element.
>>> CSS should have following features in order it to work :
>>> 
>>> 1) behavior: checkbox;  - this declares the DOM element to behave as
>>>     checkbox - click on the element simply switches :checked state on and off
>>>     on that element.
>> 
>> During the face-to-face, I learned from Anne (assuming I understood correctly, which is sometimes a leap of faith) that a feature of HTML5 is that the attribute values are live, so you can have a selector like this: input[type=checkbox][checked], and it would only apply when the checkbox was checked, and not just looking at its checked state during load time. I'm not sure if any UAs do this now. But, I think it means you can do this for the 'details' element:
>> 
>> details[open] { /* only applies when the details box is open */ }
> 
> Maybe I was not clear enough, but this is only the case for the <details> element. We cannot change the way form controls work with all the content deployed. They still have the somewhat crappy distinction between attributes and state. (Though I suppose some might consider this a feature.)

Ah, see, I extrapolated it into a general feature. Sorry to misrepresent what you said. But at least it would work for DETAILS.

Received on Wednesday, 7 April 2010 14:17:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT