Last Comment Bug 743217 - Do not allow iframes to lock the screen if a parent window's element is fullscreened
: Do not allow iframes to lock the screen if a parent window's element is fulls...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: Mounir Lamouri (:mounir)
:
Mentors:
Depends on:
Blocks: 740188
  Show dependency treegraph
 
Reported: 2012-04-06 06:19 PDT by Mounir Lamouri (:mounir)
Modified: 2012-04-10 13:08 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (915 bytes, patch)
2012-04-06 06:19 PDT, Mounir Lamouri (:mounir)
bugs: review+
mounir: checkin+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2012-04-06 06:19:29 PDT
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.
Comment 1 Olli Pettay [:smaug] 2012-04-06 08:50:21 PDT
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;

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