[Bug 28051] New: [imports]: showing <dialog> from import

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28051

            Bug ID: 28051
           Summary: [imports]: showing <dialog> from import
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: annevk@annevk.nl
          Reporter: ashley@scirra.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, www-dom@w3.org
            Blocks: 20683

(Submitted as a followup from crbug.com/458799 and public-webapps@w3.org email)

It appears if a <dialog> is defined in a HTML import, calling showModal()
attempts to show it in the HTML import's document, which is not visible. It
would probably be more useful to show it on the main document.

Use case: a web component is used via a HTML import, and the component wants to
show a dialog at some point. Naturally the dialog will be defined in the
component's import, but calling showModal() will not actually cause the dialog
to be visible to the user.

Workaround: using JS code, the component can detach its <dialog> from the
import document and append it to the main document. Then it can be shown as
expected. However this probably ought to happen automatically or not be
necessary.

Suggested possible resolutions:
#1) if a dialog is not in the main document, when shown it must be detached and
appended to the main document, and when closed detached and reinserted back to
its HTML import
#2) allow a dialog to be shown in a HTML import document, but have it work the
same as #1 by some other means (automagic?)
#3) explicitly specify that the current behavior is how it is intended to work
with HTML imports, and note that frameworks are expected to use a workaround
(e.g. #1 via JS code).

I would prefer resolution #1 since that's just getting the browser to do what
any JS framework would do to work around this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 18 February 2015 16:37:53 UTC