Primary eng (and PM) emails
fal...@chromium.org (eng)
Spec
http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#the-dialog-element
Summary
An HTML element for a pop-up in a web page. Dialogs exist in DOM and can be styled with CSS as usual. They can be optionally page-modal and have special positioning properties (centered within the viewport by default).
Link to “Intent to Implement” blink-dev discussion
This work started in WebKit: https://lists.webkit.org/pipermail/webkit-dev/2012-July/021343.html
Motivation (as it would have appeared in our “Intent to Implement”)
Dialogs are such common UI components today that it makes sense to support them natively. This page shows many real world examples. Web developers have expressed positive interest in this feature.
Hand-rolled dialogs, even those provided by frameworks, often have accessibility problems (pages like here and here detail the difficulties of getting it right). Accessibility is a major motivation for the <dialog> spec, see: http://www.w3.org/html/wg/wiki/User:Eoconnor/ISSUE-133 and http://www.w3.org/html/wg/wiki/ChangeProposals/modal
Is this feature supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
Yes.
Demo link
http://demo.agektmr.com/dialog/
Compatibility Risk
<dialog> is part of the W3C and WHATWG HTML specifications.
The biggest risk is that other vendors are not yet implementing this feature. However, they have commented positively about it. Most seem to agree it's a nice feature to have and is uncontroversial since it basically just provides natively what many existing JS frameworks provide, but they just haven't prioritized its implementation.
For example, when WebKit folks removed the bit-rotted <dialog> implementation, there were comments that they'd like to eventually support it and are not purposely postponing it.
Mozilla has a bug including a testcase.
OWP launch tracking bug?
Link to entry on the feature dashboard
My only concern would be that we should make sure to get the focus stuffright really soon if we don't do it before we ship. The spec side of this
is still evolving but hopefully should be nailed down soon.
the last control of a dialog, when you have multiple non-modal dialogsThere are lots of questions. For example, what happens when you tab from
visible? What gets focus if you open a dialog and then close it again, if
something had focus before?
I'm not saying this should block shipping, just that we should make sure
to have this stuff in mind and be ready to fix it up sooner rather than
later.
Nobody seems to have raised any objections with the proposal yet, so
hopefully I'll be able to spec it out in a few days. (The proposal also
tidies up a lot of looose ends with focus, like what the story is with
'overflow:scroll' regions, which no spec currently talks about, but
which should clearly be focusable.)
On Fri, Dec 13, 2013 at 10:20 AM, Ian Hickson <i...@hixie.ch> wrote:the last control of a dialog, when you have multiple non-modal dialogsThere are lots of questions. For example, what happens when you tab from
visible? What gets focus if you open a dialog and then close it again, if
something had focus before?Great questions, but I don't think I've ever seen a site that rolls its own dialogs get these details right either, so fixing these cases is unlikely to break any early adopters of <dialog>.
Freeriding on this discussion , will a native dialog element allow scope for the mobile experience to be optimised? Many BYO solutions, including the polyfill on the demo site, have problems like:- can't dismiss modal dialog by tapping outside it
- very easy to "loose" the dialog on a large page as it scrolls with the content. especially if zoomed right in you often have to search around for the close button. (Primarily an issue when viewing desktop site on small screen)Having modal dialog stick to the viewport (and be sized within the width of it) would help a lot.
This intent is still open. Has there been an update on the "focus stuff" so that we can make a final decision for shipping? It sounds like folks are very much in favor of the feature, but a spec editor saying that the spec isn't ready is obviously concerning. :)
On Tue, 7 Jan 2014, Elliott Sprehn wrote:We can always add a primitive for this behaviour, but it's not clear that
>
> I think we should push back on the <dialog> spec to not introduce more
> magical behavior that cannot be explained in terms of our existing CSS
> primitives and JS (plus a top layer primitive since that explains both
> dialog and full screen).
it would have any other use cases.
On Tue, Jan 7, 2014 at 9:59 AM, Eric Seidel <ese...@chromium.org> wrote:
This intent is still open. Has there been an update on the "focus stuff" so that we can make a final decision for shipping? It sounds like folks are very much in favor of the feature, but a spec editor saying that the spec isn't ready is obviously concerning. :)I've been working in the render tree construction code recently and I have to say I'm not a fan of the magical absolute position that the HTML spec has added either. It violates the principles that Dimitri has posted recently and means we end up with an if(dialog) doSomethingSpecial() inside render tree construction and also inside RenderView::layout().Older versions of our implementation used to just set top/left which was at least explainable and allowed implementing <dialog> as a custom element. Hixie@ pushed us to implement a version that cannot be explained in web primitives which I think was a mistake. The current version of the spec cannot be implemented in terms of JS, even with a top layer primitive, because it needs to hook the render tree construction to make the ICB it's containing block.
On Tue, 7 Jan 2014, Eric Seidel wrote:
>
> This intent is still open. Has there been an update on the "focus
> stuff" so that we can make a final decision for shipping? It sounds
> like folks are very much in favor of the feature, but a spec editor
> saying that the spec isn't ready is obviously concerning. :)
Implementing is fine. I just said that we should be sure to update it as
the spec is updated. Sorry for any ambiguity.
My lgtm still stands