Last Comment Bug 840640 - (dialog-element) [meta] Implement the HTML5 dialog element
(dialog-element)
: [meta] Implement the HTML5 dialog element
Status: ASSIGNED
[parity-chrome][parity-opera]
: dev-doc-needed, DevAdvocacy, html5, meta
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
-- normal with 73 votes (vote)
: ---
Assigned To: Tim Nguyen :ntim
:
: Jet Villegas (:jet)
Mentors:
Depends on: 1322939 1322946 1322947 1324958 1330659 1322938
Blocks: html5 html5test 981796 1230801
  Show dependency treegraph
 
Reported: 2013-02-12 11:42 PST by Dave Hodder
Modified: 2017-02-15 10:57 PST (History)
71 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
HTML testcase (4.86 KB, text/html)
2013-03-02 03:52 PST, Dave Hodder
no flags Details
WIP (doesn't compile) (8.39 KB, patch)
2016-12-11 10:49 PST, Tim Nguyen :ntim
no flags Details | Diff | Splinter Review

Description User image Dave Hodder 2013-02-12 11:42:20 PST
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130201065344

Steps to reproduce:

Please add support for the dialog element, which makes it easier to develop stackable dialog boxes and pop-up UI components within an HTML document.

http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#the-dialog-element

http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-dialog-element

(Work to support <dialog> and its associated API within WebKit began in 2012, but is not yet complete.)
Comment 1 User image :Ms2ger (⌚ UTC+1/+2) 2013-02-12 11:53:17 PST
Sounds like something humph would be interested in :)
Comment 2 User image Dave Hodder 2013-03-02 03:52:24 PST
Created attachment 720266 [details]
HTML testcase
Comment 3 User image Peter Gasston 2013-09-27 06:28:26 PDT
There is an implementation of this in the latest builds of Chrome Canary (32.0.1653.0) and a demo and polyfill here: http://demo.agektmr.com/dialog/
Comment 4 User image Matt Falkenhagen 2013-12-10 18:29:03 PST
Hi all. I've been working on implementing <dialog> in Chrome behind a flag and am thinking of exposing it by default soon. I'm curious about whether Mozilla folks feel positively about this feature and the current spec, or if anyone feels shipping is a bad idea?

Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#the-dialog-element
Demo: http://demo.agektmr.com/dialog/
Comment 5 User image Marc Nieper-Wißkirchen 2014-05-26 04:54:04 PDT
Implementing the dialog element makes sense in my opinion because it is hard to polyfill correctly. Modal dialogs have to render all nodes but themselves (and descendants) inert. However, without implementing showModal, one cannot make nodes inert by script.

Workarounds are to listen for focus changes and setting the focus back onto the dialog whenever it leaves and to prevent further events from happening outside the dialog by putting a backdrop between the dialog and the rest of the document. Finally, one usually adds aria-hidden="true" onto the non-dialog part of the document.

This raises a number of problems, though: 1) There might be another way to access the document that is not fully inert than by just preventing mouse and keyboard events and controlling the focus. 2) The dialog element cannot be a descendant of anything that has to be made inaccessible (due to the way aria-hidden works). 3) Trapping the focus inside the dialog means that one cannot access the location bar with the tab key without closing the dialog first.
Comment 6 User image Dave Hodder 2014-09-24 12:20:45 PDT
Chrome and Opera now have mostly complete support, including support for <form method="dialog">. They omit support for specifying an optional anchor point argument on .show() and .showModal().

There is MDN reference documentation at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog and https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement.
Comment 7 User image Marco Zehe (:MarcoZ) 2014-11-27 08:12:16 PST
This would be very useful to have for accessibility, too. It would mittigat e the need for web authors to create their own dialog widgets and have to use hacks like aria-hidden to hide everything *outside* the dialog widget from assistive technologies for people with disabilities. It is a real nuisance to deal with from both an evangelism and technical standpoint, and having the native html:dialog element implemented would hugely improve the lives of many many people.
Comment 8 User image jlregeim 2015-05-04 14:23:57 PDT
With the planned removal of showModalDialog, this feature should get implemented rather than forcing applications to polyfill dialog functionality.  See https://bugzilla.mozilla.org/show_bug.cgi?id=981796 for more on the removal of showModalDialog.
Comment 9 User image jgw9617 2015-10-20 11:30:05 PDT Comment hidden (me-too)
Comment 10 User image jgw9617 2015-10-20 11:30:56 PDT
Also, native dialogs would be even more useful on FirefoxOS
Comment 11 User image Potch [:potch] 2016-06-21 17:47:15 PDT
Seeing interest in this spike again recently, tracking this with DevAdvocacy.
Comment 12 User image Xidorn Quan [:xidorn] (UTC+10) 2016-06-21 17:57:01 PDT
Probably someone could take this and implement functions other than dialog.showModal().

To implement dialog.showModal() correctly, we need to convert our fullscreen stack into top layer stack, and handle both fullscreen and modal dialog there. To having the fully-implemented top layer stack, we may need to finish bug 1195213 first. And I don't think other parts of <dialog> should be blocked by that.
Comment 13 User image Tim Nguyen :ntim 2016-12-11 10:49:33 PST
Created attachment 8817913 [details] [diff] [review]
WIP (doesn't compile)

Leaving it here as reference.
Comment 14 User image Xidorn Quan [:xidorn] (UTC+10) 2016-12-11 14:54:11 PST
That bug should be considered to be a blocker of bug 1322939.
Comment 15 User image Mats Palmgren (:mats) 2016-12-16 06:53:34 PST
I can't seem to find an "intent to implement" for this feature,
did you send one?
Comment 16 User image Tim Nguyen :ntim 2016-12-16 08:15:29 PST
(In reply to Mats Palmgren (:mats) from comment #15)
> I can't seem to find an "intent to implement" for this feature,
> did you send one?

I've sent one on Monday, it's still awaiting approval unfortunately.
Comment 17 User image Mats Palmgren (:mats) 2016-12-20 15:48:03 PST
> I've sent one on Monday, it's still awaiting approval unfortunately.

I still haven't seen it, so I suspect something might have gone wrong.
Could you file a bug about that, or notify the people responsible
somehow?

Meanwhile, I can send it for you if you want.
Comment 18 User image Tim Nguyen :ntim 2016-12-20 16:03:52 PST
(In reply to Mats Palmgren (:mats) from comment #17)
> > I've sent one on Monday, it's still awaiting approval unfortunately.
> 
> I still haven't seen it, so I suspect something might have gone wrong.
> Could you file a bug about that, or notify the people responsible
> somehow?
Looks like non-member posts take forever to get moderated. I've joined the list and posted, and it worked: https://groups.google.com/forum/#!topic/mozilla.dev.platform/vTPGW1aJq24
Comment 19 User image David Bolter [:davidb] 2017-01-03 05:54:46 PST
Nice to see activity on the dependencies! Please ping MarcoZ (back next week) for accessibility reviews.
Comment 20 User image steve faulkner 2017-01-13 05:57:31 PST
A key aspect to ensuring the usability/accessibility of the Firefox dialog implementation is to move focus to the dialog container when a dialog is displayed. This is not what is currently specced, but there is a related issue https://github.com/whatwg/html/issues/1929 I would suggest that firefox should implement whats best for users rather than whats in the spec, in this regards.

Another consideration is moving focus back to the triggering element when a dialog is dismissed.
Comment 21 User image steve faulkner 2017-01-14 08:05:00 PST
(In reply to steve faulkner from comment #20)
> A key aspect to ensuring the usability/accessibility of the Firefox dialog
> implementation is to move focus to the dialog container when a dialog is
> displayed. This is not what is currently specced, but there is a related
> issue https://github.com/whatwg/html/issues/1929 I would suggest that
> firefox should implement whats best for users rather than whats in the spec,
> in this regards.
> 
> Another consideration is moving focus back to the triggering element when a
> dialog is dismissed.

After further discussion on this spec bug https://github.com/whatwg/html/issues/1929 There appears to be rough consensus around implementing default focus on the dialog element.

Note You need to log in before you can comment on or make changes to this bug.