This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21771 - WindowModal.returnValue should be |any|
Summary: WindowModal.returnValue should be |any|
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on: 21932
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-22 19:57 UTC by Bobby Holley (:bholley)
Modified: 2013-07-02 20:46 UTC (History)
3 users (show)

See Also:


Attachments

Description Bobby Holley (:bholley) 2013-04-22 19:57:56 UTC
Since WindowModal.returnValue is a DOMString and defaults to the empty string, I don't see any way for a non-string type to be returned. In general, |any| in WebIDL is yucky.
Comment 1 Bobby Holley (:bholley) 2013-05-06 21:35:37 UTC
Actually, my testing in [1] indicates that Gecko, Chrome, and IE all currently support passing arbitrary objects as returnValues. So presumably it's the WindowModal IDL that needs to change.


[1] - http://people.mozilla.com/~bholley/testcases/xomodal.html
Comment 2 contributor 2013-06-14 18:15:54 UTC
Checked in as WHATWG revision r7976.
Check-in comment: WindowModal.returnValue isn't limited to strings.
http://html5.org/tools/web-apps-tracker?from=7975&to=7976
Comment 3 Bobby Holley (:bholley) 2013-06-14 18:23:25 UTC
This isn't enough, I don't think:

* We need to spec the security check to returnValue, which should be isomorphic to that of dialogArguments.
* returnValue should probably default to undefined, rather than the empty string.

(Sorry if reopening the bug isn't correct etiquette here - is a followup preferred?)
Comment 4 Ian 'Hixie' Hickson 2013-07-02 19:22:22 UTC
Reopening is absolutely fine, please don't hesitate to reopen bugs I screw up!

I've tried to make returnValue's logic match Firefox's behaviour, at least insofar as it is demonstrated by these demo tests (001-004):

   http://www.hixie.ch/tests/adhoc/dom/level0/window/showModalDialog/
Comment 5 contributor 2013-07-02 19:22:32 UTC
Checked in as WHATWG revision r8008.
Check-in comment: Make showModalDialog()'s returnValue logic more closely match Firefox. Previously it matched nobody. None of the browsers match each other. Firefox's behaviour seems the sanest.
http://html5.org/tools/web-apps-tracker?from=8007&to=8008
Comment 6 Bobby Holley (:bholley) 2013-07-02 20:46:43 UTC
This looks great. Thanks. :-)