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

Issue 240993003: Fix the issue with adding/removing event listeners for Device Motion/Orientation. (Closed)

Created:
6 years, 8 months ago by timvolodine
Modified:
6 years, 8 months ago
CC:
blink-reviews, mvanouwerkerk+watch_chromium.org, Inactive, timvolodine, Peter Beverloo, abarth-chromium
Visibility:
Public.

Description

Fix the issue with adding/removing event listeners for Device Motion/Orientation. Make sure to only stop updating Device Motion/Orientation when there are no event listeners. Currently Device Motion/Orientation stops updating upon first event listener removal which is problematic in case multiple event listeners are registered. BUG=364491 TEST=Layout test and also http://jsbin.com/motion. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172165

Patch Set 1 #

Patch Set 2 : similarity=80 #

Total comments: 13

Patch Set 3 : fixed comments #

Patch Set 4 : added fix and test for device orientation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -22 lines) Patch
A LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html View 1 2 1 chunk +113 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners-expected.txt View 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceOrientation/multiple-event-listeners.html View 1 2 3 1 chunk +88 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceOrientation/multiple-event-listeners-expected.txt View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionController.cpp View 1 2 3 2 chunks +15 lines, -12 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationController.cpp View 1 2 3 2 chunks +13 lines, -10 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
timvolodine
6 years, 8 months ago (2014-04-17 14:32:31 UTC) #1
Inactive
https://codereview.chromium.org/240993003/diff/20001/Source/modules/device_orientation/DeviceMotionController.cpp File Source/modules/device_orientation/DeviceMotionController.cpp (right): https://codereview.chromium.org/240993003/diff/20001/Source/modules/device_orientation/DeviceMotionController.cpp#newcode101 Source/modules/device_orientation/DeviceMotionController.cpp:101: && window->hasEventListeners(EventTypeNames::devicemotion)) { How can this new condition ever ...
6 years, 8 months ago (2014-04-17 14:38:19 UTC) #2
Inactive
https://codereview.chromium.org/240993003/diff/20001/LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html File LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html (right): https://codereview.chromium.org/240993003/diff/20001/LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html#newcode6 LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html:6: <script src="script-tests/multiple-event-listeners.js"></script> I think it is frown upon to ...
6 years, 8 months ago (2014-04-17 14:39:32 UTC) #3
Inactive
https://codereview.chromium.org/240993003/diff/20001/Source/modules/device_orientation/DeviceMotionController.cpp File Source/modules/device_orientation/DeviceMotionController.cpp (right): https://codereview.chromium.org/240993003/diff/20001/Source/modules/device_orientation/DeviceMotionController.cpp#newcode101 Source/modules/device_orientation/DeviceMotionController.cpp:101: && window->hasEventListeners(EventTypeNames::devicemotion)) { On 2014/04/17 14:38:20, Chris Dumez wrote: ...
6 years, 8 months ago (2014-04-17 14:43:17 UTC) #4
Peter Beverloo
It would be great if you could remove the runtime flags for Device Motion and ...
6 years, 8 months ago (2014-04-17 14:48:17 UTC) #5
timvolodine
thanks for the comments. I've also removed the runtime flag check. https://codereview.chromium.org/240993003/diff/20001/LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html File LayoutTests/fast/dom/DeviceMotion/multiple-event-listeners.html (right): ...
6 years, 8 months ago (2014-04-17 15:34:13 UTC) #6
Inactive
lgtm but I am not an OWNER for this folder.
6 years, 8 months ago (2014-04-17 15:36:54 UTC) #7
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 8 months ago (2014-04-22 19:59:47 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/240993003/60001
6 years, 8 months ago (2014-04-22 20:00:20 UTC) #9
commit-bot: I haz the power
6 years, 8 months ago (2014-04-22 20:07:56 UTC) #10
Message was sent while issue was closed.
Change committed as 172165

Powered by Google App Engine
This is Rietveld 408576698