[whatwg] Comments on <dialog>

Elliott Sprehn esprehn at chromium.org
Thu Dec 19 02:51:49 PST 2013


On Wed, Dec 18, 2013 at 4:58 PM, Brian Blakely <anewpage.media at gmail.com>wrote:

> On Wed, Dec 18, 2013 at 2:13 PM, Ian Hickson <ian at hixie.ch> wrote:
>
> > On Wed, 18 Dec 2013, Brian Blakely wrote:
> > > On Tue, Dec 17, 2013 at 3:14 PM, Ian Hickson <ian at hixie.ch> wrote:
> > > >
> > > > I've added a rule to the spec that says that viewports have to be
> > > > pannable so you can see all of a dialog, but I don't know how
> feasible
> > > > that really is.
> > >
> > > I could see implementations using shadow <div>s to satisfy this It
> might
> > > be beneficial to even codify kind of element as ::modal, representing a
> > > modal layer acting as an ancestor for both the ::backdrop and <dialog>.
> >
> > Not really sure how this would work. Can you elaborate?
> >
>
> This is what the shadow DOM would look like for modal dialogs:
>
> ::modal
> -  ::backdrop
> -  <dialog>
>
> ::modal is <dialog>'s ancestor, and is available when showModal is called.
>  This allows authors to set CSS overflow to whichever value suits their
> use-case, and for user agents to establish overflow: auto as the default,
> making the dialog inherently pannable when it exceeds the viewport.
>
>
We can't implement that inside Blink. It requires <dialog> to have two
parents, the real one in the DOM and ::modal. The only way I can see this
working is if we special case the Shadow DOM projection logic for <dialog>
so that it is always projected into ::modal, but we don't want any special
cases in projection.

- E



More information about the whatwg mailing list