Do not allow iframes to lock the screen if a parent window's element is fullscreened

RESOLVED FIXED in mozilla14

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 612864 [details] [diff] [review]
Patch

This could be abused *and* that was causing a bug because the 'mozfullscreenchange' event is only sent to parent windows so leaving fullscreen wasn't unlocking the screen.
Attachment #612864 - Flags: review?(bugs)
(Assignee)

Updated

5 years ago
Blocks: 740188
Whiteboard: [needs review]
Comment on attachment 612864 [details] [diff] [review]
Patch

># HG changeset patch
># Parent da0d07b5ca1e79037eb66bad22bd2b3aeb106dc8
># User Mounir Lamouri <mounir.lamouri@gmail.com>
># Date 1333718342 -7200
>
>diff --git a/dom/base/nsScreen.cpp b/dom/base/nsScreen.cpp
>--- a/dom/base/nsScreen.cpp
>+++ b/dom/base/nsScreen.cpp
>@@ -367,18 +367,25 @@ nsScreen::MozLockOrientation(const nsASt
>   }
> 
>   if (!GetOwner()) {
>     *aReturn = false;
>     return NS_OK;
>   }
> 
>   if (!IsChromeType(GetOwner()->GetDocShell())) {
>+    nsCOMPtr<nsIDOMDocument> doc;
>+    GetOwner()->GetDocument(getter_AddRefs(doc));
>+    if (!doc) {
>+      *aReturn = false;
>+      return NS_OK;
>+    }
>+
>     bool fullscreen;
>-    GetOwner()->GetFullScreen(&fullscreen);
>+    doc->GetMozFullScreen(&fullscreen);
>     if (!fullscreen) {
>       *aReturn = false;
>       return NS_OK;
>     }
> 
>     nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
>     if (!target) {
>       *aReturn = false;
Attachment #612864 - Flags: review?(bugs) → review+
(Assignee)

Updated

5 years ago
Attachment #612864 - Flags: checkin+
(Assignee)

Updated

5 years ago
Whiteboard: [needs review]
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/ab8239e81ae4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.