This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://dev.w3.org/html5/spec/Overview.html Multipage: http://www.whatwg.org/C#top Complete: http://www.whatwg.org/c#top Comment: I think it would be usefull to add a new event to the details element which would fire when it is opened or closed. Posted from: 79.113.72.32 User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Not a bad idea. We could reuse onchange, or we could introduce onopen/onclose... any opinions?
It would have to be a queued task that fires the event, and it would have to coalesce events so if the attribute is toggled a lot in a row, only one event actually fires. Maybe just by delaying the event if there's another task already queued (can be done by having the element have a counter which is incremented when a task is queued, decremented when the task runs, and the event is only fired when the count is zero after the decrement).
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Partially Accepted Change Description: none yet Rationale: I'm going to delay this while we wait for more implementation experience (there's only one browser shipping <details> currently it seems). In the meantime, if anyone has any good suggestion for an event name, that'd be great. I'd rather have a single event, which rules out onopen/onclose, and I'd rather not interfere with forms (which rules out onchange).
*** Bug 15438 has been marked as a duplicate of this bug. ***
Since details either has a state of open or closed, how about onstatechange