[webkit-efl] FW: window.showModalDialog()

Jussi Kukkonen jussi.kukkonen at intel.com
Mon Jan 7 11:47:17 PST 2013


On Mon, Jan 7, 2013 at 6:24 PM, Thiago Marcos P. Santos
<tmpsantos at gmail.com> wrote:
> On Mon, Jan 7, 2013 at 2:43 PM, Jussi Kukkonen <jussi.kukkonen at intel.com> wrote:
>> On Sat, Jan 5, 2013 at 6:15 AM, Sun, Xun <xun.sun at intel.com> wrote:
>>> Hi folks,
>>>
>>> I posted this query on the product-dev at lists.tizen.org list but got no comments so far.
>>>
>>> Could someone please comment if window.showModalDialog() would be a welcomed feature for Webkit-efl? (Webkit2 of course)
>>
>> I'm not sure about this... modal dialog (as specified in
>> window.showModalDialog()) is pretty horrible. Is there a single mobile
>> browser that implements it? For that matter, does any webkit browser
>> truly implement window.showModalDialog() as modal? Chrome definitely
>> doesn't.
>>
>> In any case my personal opinion is that window.showModalDialog() is
>> not a correct answer to any sane question. I'm happy to be proven
>> wrong though, so feel free to expand if you have a real use case.
>>
>> Personally I'd rather see support for HTML5 DialogElement
>> (http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-dialog-element),
>> a cleaner implementation of the same idea. I have a recollection that
>> there's at least some experimental code in webkit.
>
> AFAIK WebKit GTK implements it with configurable options to disable on
> runtime. While I also hate modal
> dialog on browsers, people writing webapps might have a valid use case for it.

Sure, there are absolutely good uses for modal dialogs (not many, but
they definitely exist). I don't have anything against having modal
elements available to web apps. This is in fact what
HTMLDialogElement.showModal() would do in a sane way.

window.showModalDialog() was an attempt to provide roughly the same
thing but it was IMO pretty badly thought out. It's telling that even
after several years not a single browser gets it right: Chrome does
not do modal dialogs at all. If I recall correctly Firefox and IE do
implement modal dialogs, but the modality covers the whole app: you
can't do _anything_  in the browser if one tab has a dialog open. All
of the implementations I've seen are also butt ugly, because you have
to leave some browser chrome in the dialog because otherwise it could
be impossible to close it (which would be disastrous since the rest of
the browser is locked as well).

This article sums my opinion pretty well:
http://tjvantoll.com/2012/05/02/showmodaldialog-what-it-is-and-why-you-should-never-use-it/

 - Jussi


More information about the webkit-efl mailing list