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 12391 - showModalDialog() should be blocked by sandbox attribute
Summary: showModalDialog() should be blocked by sandbox attribute
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/spec/Overview...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 07:02 UTC by Jacob Rossi [MSFT]
Modified: 2011-08-04 05:33 UTC (History)
5 users (show)

See Also:


Attachments

Description Jacob Rossi [MSFT] 2011-03-29 07:02:14 UTC
From the current spec text, it's not clear that window.showModalDialog( ) should be blocked inside a sandboxed iframe. It seems that it should follow in the same suit as window.open(). 

showModalDialog() should be added to the sentence "This flag also prevents content from creating new auxiliary browsing contexts, e.g. using the target attribute or the window.open() method." [1]

Additionally, in the steps for executing showModalDialog [2], the first step should indicate that the UA should abort these steps if the "sandboxed navigation browsing context flag" is set.


[1] http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox
[2] http://dev.w3.org/html5/spec/Overview.html#dom-showmodaldialog
Comment 1 Ian 'Hixie' Hickson 2011-06-13 22:27:59 UTC
The sentence "This flag also prevents content from creating new auxiliary browsing contexts, e.g. using the target attribute or the window.open() method." is non-normative, and is a rather vague description of reality (which is that it's largely up to the UA what happens). Since you're an implementor, please ignore the non-normative text. :-)

Blocking showModelDialog() seems reasonable. Should it be always blocked, or should the UA have the option of allowing it anyway, as with window.open()? I'm guessing it should just always block, since it's more synchronous.
Comment 2 Ian 'Hixie' Hickson 2011-06-15 06:14:15 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale:

Turns out that showModalDialog() was sort of blocked already, in that it would pop up a window but not load anything in the window. Oops. I've made it so that it is blocked earlier.
Comment 3 contributor 2011-06-15 06:28:26 UTC
Checked in as WHATWG revision r6233.
Check-in comment: showModalDialog() inside a sandboxed iframe should be blocked _before_ the window pops up... Also, some minor editorial cleanup in this area.
http://html5.org/tools/web-apps-tracker?from=6232&to=6233
Comment 4 Michael[tm] Smith 2011-08-04 05:33:45 UTC
mass-move component to LC1