Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 280283002: Stop firing orientationchange events at pages that are not visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase now that dependency patch has landed Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 09c78c8d4f8ed7b0cb884c85ee56f153ecf98978..63708d4c0660f072ea9ce54de598d8592360e1b8 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -167,6 +167,10 @@ void LocalFrame::sendOrientationChangeEvent()
if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled())
return;
+ // Don't fire 'orientationchange' events at pages that are not visible.
mlamouri (slow - plz ping) 2014/05/28 14:05:33 nit: I'm pretty sure the code is self explanatory
Inactive 2014/05/28 15:27:28 Done.
+ if (page()->visibilityState() != PageVisibilityStateVisible)
+ return;
+
DOMWindow* window = domWindow();
if (!window)
return;

Powered by Google App Engine
This is Rietveld 408576698