Last Comment Bug 766481 - Handle window.alert/prompt/confirm in <iframe> within <iframe mozbrowser>
: Handle window.alert/prompt/confirm in <iframe> within <iframe mozbrowser>
Status: RESOLVED FIXED
[qa+]
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Justin Lebar (not reading bugmail)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: browser-api 741587 766871
  Show dependency treegraph
 
Reported: 2012-06-20 01:11 PDT by Tim Guan-tin Chien [:timdream] (please needinfo)
Modified: 2013-04-04 13:53 PDT (History)
28 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch, v1 (1.25 KB, patch)
2012-06-20 19:56 PDT, Justin Lebar (not reading bugmail)
no flags Details | Diff | Splinter Review
Tests, v1 (5.38 KB, patch)
2012-06-20 19:57 PDT, Justin Lebar (not reading bugmail)
mounir: review+
Details | Diff | Splinter Review
Patch v2 (1.31 KB, patch)
2012-06-23 05:00 PDT, Justin Lebar (not reading bugmail)
mounir: review+
Details | Diff | Splinter Review

Description Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-20 01:11:33 PDT
+++ This bug was initially created as a clone of Bug #742944 +++

Gaia issue: https://github.com/mozilla-b2g/gaia/issues/1802

For HTML structure like this:

<iframe mozbrower>
    <iframe>
       <button onclick="alert('hi')">Alert</button>
    </iframe>
</iframe>

The alert() call can bypass the mozbrowser capability implemented in Bug #742944

STR:

Launch Gaia "UI Tests" app and try the alert/prompt test.
Comment 1 Justin Lebar (not reading bugmail) 2012-06-20 06:59:28 PDT
Is the problem alert() or window.open?

Or do both not work within <iframe>s?
Comment 2 Justin Lebar (not reading bugmail) 2012-06-20 07:00:35 PDT
Also, these dependencies / blocking bugs are probably not what you mean, but I'm not sure what you mean for this bug to cover, so I don't want to change them.
Comment 3 Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-20 07:14:44 PDT
@jlebar Yeah I totally missed up with the dependency thing ...

I've updated the title. Can you fix the dependency? Thanks.
Comment 4 Justin Lebar (not reading bugmail) 2012-06-20 19:56:49 PDT
Created attachment 635170 [details] [diff] [review]
Patch, v1
Comment 5 Justin Lebar (not reading bugmail) 2012-06-20 19:57:37 PDT
Created attachment 635171 [details] [diff] [review]
Tests, v1

This was a pretty dumb bug.  Oh well.
Comment 6 Justin Lebar (not reading bugmail) 2012-06-23 05:00:42 PDT
Created attachment 636066 [details] [diff] [review]
Patch v2

Even better; now it's a one-line fix.
Comment 8 Olli Pettay [:smaug] 2012-07-20 08:17:57 PDT
What is the change to nsGenericElement.cpp ?
https://hg.mozilla.org/mozilla-central/rev/f3cd319dd52d
Comment 9 Justin Lebar (not reading bugmail) 2012-07-20 08:21:23 PDT
(In reply to Olli Pettay [:smaug] from comment #8)
> What is the change to nsGenericElement.cpp ?
> https://hg.mozilla.org/mozilla-central/rev/f3cd319dd52d

Known bug in hg, although I can't find the bug at the moment.  It seems to be harmless, although certainly quite scary.

Note You need to log in before you can comment on or make changes to this bug.