Index: Source/core/frame/DeviceSensorEventController.cpp |
diff --git a/Source/core/frame/DeviceSensorEventController.cpp b/Source/core/frame/DeviceSensorEventController.cpp |
index 5ffa369be494a6bdd700d4b41f8cc5081b5fb6bf..f128a4e426f102a44111172d5100d285a9a69301 100644 |
--- a/Source/core/frame/DeviceSensorEventController.cpp |
+++ b/Source/core/frame/DeviceSensorEventController.cpp |
@@ -101,12 +101,9 @@ void DeviceSensorEventController::stopUpdating() |
void DeviceSensorEventController::pageVisibilityChanged() |
{ |
- if (!m_hasEventListener) |
- return; |
- |
- if (page()->visibilityState() == PageVisibilityStateVisible) |
+ if (page()->visibilityState() == PageVisibilityStateVisible && m_hasEventListener) |
startUpdating(); |
- else |
+ else if (page()->visibilityState() == PageVisibilityStateHidden) |
stopUpdating(); |
} |