Closed Bug 769848 Opened 13 years ago Closed 12 years ago

window.resizeTo fails is blocked in apps

Categories

(Firefox Graveyard :: Webapp Runtime, defect, P2)

defect

Tracking

(firefox16 wontfix)

RESOLVED FIXED
Firefox 26
Tracking Status
firefox16 --- wontfix

People

(Reporter: dmosedale, Assigned: marco)

References

Details

Attachments

(1 file, 3 obsolete files)

Tested in an app installed on a Mac Nightly with this UA: 16.0a1 (2012-06-29). I have game with a canvas in it, and I want to resize the window to exactly the size of the canvas. resizeTo simply does nothing, leaving me with a canvas and a giant ell of whitespace that looks very odd. This is presumably a consequence of Gecko intentionally blocking it in untrusted content <https://bugzilla.mozilla.org/show_bug.cgi?id=565541#c24>. I would expect that this restriction wants to be lifted in the more trusted app context.
Group: webtools-security
Assignee: ianb → nobody
Component: HTML → Webapp Runtime
Product: Web Apps → Firefox
QA Contact: webapp-runtime
QA Contact: jsmith
Priority: -- → P2
OS: Mac OS X → All
Hardware: x86 → All
Attached patch allow_window_resize_webapps (obsolete) — Splinter Review
The other possible approach is overriding the resizeTo function and calling it again from Chrome code (I'm not sure it would actually work, it's just an idea).
Assignee: nobody → mcastelluccio
Status: NEW → ASSIGNED
Attachment #782052 - Flags: feedback?(myk)
Attached patch allow_window_resize_webapps (obsolete) — Splinter Review
Forgot to qref...
Attachment #782052 - Attachment is obsolete: true
Attachment #782052 - Flags: feedback?(myk)
Attachment #782053 - Flags: feedback?(myk)
Comment on attachment 782053 [details] [diff] [review] allow_window_resize_webapps This seems reasonable to me, but I'd like to see what a DOM peer thinks about it. jst: apps running in the desktop runtime should be able to determine the sizes of their windows, so we're trying to figure out the best way to enable resizeTo in the runtime (without affecting its behavior in desktop Firefox). (In reply to Marco Castelluccio [:marco] from comment #1) > The other possible approach is overriding the resizeTo function and calling > it again from Chrome code (I'm not sure it would actually work, it's just an > idea). That might work, but it seems better to make the platform be runtime-aware.
Attachment #782053 - Flags: feedback?(myk)
Attachment #782053 - Flags: feedback?(jst)
Attachment #782053 - Flags: feedback+
Comment on attachment 782053 [details] [diff] [review] allow_window_resize_webapps In general this seems fine, but this patch as written is not good enough. In particular we must not bypass the drag service code at the end of this changed method. feedback- because of that.
Attachment #782053 - Flags: feedback?(jst) → feedback-
Attached patch Patch (obsolete) — Splinter Review
Attachment #782053 - Attachment is obsolete: true
Attachment #787085 - Flags: review?(jst)
Comment on attachment 787085 [details] [diff] [review] Patch if (mDocShell) { bool allow; nsresult rv = mDocShell->GetAllowWindowControl(&allow); + + // This preference is useful for the webapp runtime. Webapps should be able + // to resize or move their window. + if (Preferences::GetBool("dom.always_allow_move_resize_window", false)) { + allow = true; + } + Given that this just ignores what GetAllowWindowControl() says we could just avoid making that call here. I.e. combine the pref check with the mDocShell null check. r=jst with that changed. I'd happily look over another patch once you have it...
Attachment #787085 - Flags: review?(jst) → review+
Attached patch Patch v2Splinter Review
Attachment #787085 - Attachment is obsolete: true
Attachment #787134 - Flags: review?(jst)
Comment on attachment 787134 [details] [diff] [review] Patch v2 Looks good!
Attachment #787134 - Flags: review?(jst) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: