Closed Bug 743217 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: mounir, Assigned: mounir)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
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)
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+
Attachment #612864 - Flags: checkin+
Whiteboard: [needs review]
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/ab8239e81ae4
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.