W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Showing <dialog> from HTML import

From: Dimitri Glazkov <dglazkov@google.com>
Date: Wed, 18 Feb 2015 07:29:57 -0800
Message-ID: <CADh5Ky0+Xm3LETgJ8+psd5q_T-MarjhOaeGeGPpqe1nBEetkMA@mail.gmail.com>
To: Ashley Gullen <ashley@scirra.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
Can you file a spec bug?



On Wed, Feb 18, 2015 at 5:18 AM, Ashley Gullen <ashley@scirra.com> wrote:

> I filed crbug.com/458799 for Chrome recently since showing a <dialog>
> defined in a HTML import did not work as I thought it should. I can't
> compare to any other browsers since right now AFAIK Chrome is the only
> browser shipping both HTML imports and <dialog>. There seemed to be some
> confusion from the browser developers over what the spec says ought to
> happen.
> It sounds like the current spec says that showing a dialog marks the "node
> document" of the dialog as being blocked. I would imagine a <dialog> in a
> HTML import has the invisible HTML import document as the node document of
> the <dialog>. Therefore it never appears on-screen (in the main document)
> when you call showModal(), but still throws if you try to open it twice.
> It can be worked around with JS: the dialog element can be detached from
> its current document and appended to the main document, and then
> showModal() works as expected.
> I think the spec may need to be altered. I think it's an obvious use case
> that a web component may want to show a dialog, and naturally that dialog
> will be defined in one of the web component's HTML imports. As it stands
> though the dialog will never appear unless the JS hack is used. I can also
> foresee that a large codebase making use of lots of dialogs ends up with
> loads of dialogs appended to the main document, instead of leaving them in
> the components where they came from.
> Not sure how this would be specified though - perhaps the dialog should be
> attached to the main document in showModal(), then re-inserted where it
> came from in close()? Sounds like a bit of a hack in itself...
> Ashley
Received on Wednesday, 18 February 2015 15:30:28 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC