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.
(Work to support <dialog> and its associated API within WebKit began in 2012, but is not yet complete.)
Sounds like something humph would be interested in :)
Created attachment 720266 [details]
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/
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?
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.
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.
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.
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.
I think the native dialog element is a great idea. Wouldn't it be awesome to have the ability to use something that is native to the platform instead of having to rely on libraries to implement this functionality for us? I would much rather use something that is native to the web platform compared to having to rely on a library. It is now in Chrome stable, and if it was implemented in Firefox then developers could actually start to use it(chrome and firefox basically own the browser market together).
Also, native dialogs would be even more useful on FirefoxOS
Seeing interest in this spike again recently, tracking this with DevAdvocacy.
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.