[whatwg] Modal dialogs in HTML5

João Eiras joao.eiras at gmail.com
Sun Apr 27 17:22:32 PDT 2008


Na , Ian Hickson <ian at hixie.ch> escreveu:


> This is a first draft. It has issues, I'm sure. Let me know what I should
> fix...
>

Hi!

What happened to the 3rd parameter (sFeatures) ?  
http://msdn2.microsoft.com/en-us/library/ms536759.aspx
This parameter is needed to specific the window features (size, position,  
...).

Also, IE supports the properties dialogLeft, dialogWidth, dialogTop and  
dialogHeight. Two of these can be read from innerWidth and innerHeight,  
while the other two are irrelevant, and hardly useful for a webpage. But,  
omitting these from the spec will create implementation discrepancies.  
Probably you could add an extra section with features that were purposely  
left out of the spec ?

I've built some time ago a comprehensive testcase (it's attached), to test  
IE's showModalDialog implementation, and besides what is common sense, IE  
drops hashes from the url which is passed to showModalDialog, and IE  
truncates, on purpose, the dialogArguments parameter to 4096 chars, if  
it's a string. I see no possible reasoning for these design choices.

Regarding the spec:
  - about step 1. : you could mention that showModalDialog might be blocked  
by popup blockers too, which is easier to understand for the crowd.
  - about step 3. : there's this clause "from running scripts". Well  
showModalDialog blocks so all script execution must be halted while  
showModalDialog does not return. So is this wording correct ?
  - about step 8. : you could add "the browing context can signal the UA to  
terminate, e.g. calling window.close()"



Another thing: while the use cases for showModelessDialog can already be  
covered by window.open(), there is a difference in behavior:
  - window.open creates a new window, which can be lose focus, and go  
behind it's opener window.
  - showModelessDialog creates a new popup window, which can too lose  
focus, but will never go behind it's opener. It'll say always in front of  
it.

Use cases ? Consider you have a web application, and some help documents.  
While you have the main application open, you can open a dialog with a  
help manual and continue to work on the application while you have the  
manual on top, without the user needing to fiddle with windows and/or tabs.
Implementing this is pretty straightforward.

MS spec on showModelessDialog:  
http://msdn2.microsoft.com/en-us/library/ms536761.aspx



Cheers.






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080428/d9bc9249/attachment-0001.html>


More information about the whatwg mailing list