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

Issue 132113006: Add initial Blink-side support for the Screen Orientation API (Closed)

Created:
6 years, 10 months ago by Inactive
Modified:
6 years, 8 months ago
CC:
blink-reviews, jamesr, arv+blink, dglazkov+blink, watchdog-blink-watchlist_google.com, Peter Beverloo, lgombos, johnme, mlamouri (slow - plz ping)
Visibility:
Public.

Description

Add initial Blink-side support for the Screen Orientation API Add initial Blink-side support for the Screen Orientation API: https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html The feature is behind a "ScreenOrientation" runtime-enabled flag. The intent to implement was sent to blink-dev: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/lgUq8K9IGlU This CL changes Screen to be an EventTarget. While the Screen Orientation API has been implemented behind a RuntimeEnabled flag, there is no way of having inheritance depend on the flag's value. The Web exposed effect of this is that people will now be able to dispatch custom events on the window.screen interface, which in itself is harmless. R=abarth, jochen, kenneth.r.christiansen@intel.com BUG=162827 TEST=screen_orientation/*

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add testing infrastructure #

Patch Set 3 : Add basic layout test #

Patch Set 4 : Rebase #

Patch Set 5 : Add Mounir as OWNER #

Patch Set 6 : Add LayoutTest for orientationchange event #

Patch Set 7 : Add locked-no-orientation-change-event.html layout test #

Total comments: 8

Patch Set 8 : Add multiple-orientations-locking.html layout test #

Patch Set 9 : Add locking-then-unlocking.html layout test #

Patch Set 10 : Add locking-fires-event.html Layout test #

Patch Set 11 : Add more Layout tests #

Patch Set 12 : Fix flaky crashes #

Patch Set 13 : Screen locking should be asynchronous #

Patch Set 14 : Attempt to fix failing layout test #

Patch Set 15 : Further code clean up #

Patch Set 16 : Add missing expected results #

Patch Set 17 : Add Kenneth as OWNER #

Total comments: 16

Patch Set 18 : Take feedback into consideration #

Total comments: 49

Patch Set 19 : Take Peter's feedback into consideration #

Patch Set 20 : Take some of Mounir's feedback into consideration #

Patch Set 21 : Take some of Mounir's feedback into consideration #

Patch Set 22 : Take some of Mounir's feedback into consideration #

Patch Set 23 : Reup #

Patch Set 24 : Reupload #

Patch Set 25 : Reupload #

Total comments: 12

Patch Set 26 : Take feedback into consideration #

Patch Set 27 : Update compile-time assertion for matching enum #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1516 lines, -7 lines) Patch
M LayoutTests/fast/dom/Window/window-appendages-cleared-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/consecutive-locking.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/consecutive-locking-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/lockOrientation-array-argument.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +59 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/lockOrientation-array-argument-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +56 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/lockOrientation-bad-array-argument-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-failure.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-failure-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +22 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-fires-event.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-fires-event-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-then-unlocking.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +55 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/locking-then-unlocking-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +21 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/multiple-orientations-locking.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +58 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/multiple-orientations-locking-expected.txt View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/orientation-change-event.html View 1 2 3 4 5 6 1 chunk +36 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/orientation-change-event-expected.txt View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/screenorientation-api.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/screenorientation-api-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/unlock-when-not-locked.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/unlock-when-not-locked-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -0 lines 0 comments Download
M Source/core/events/EventTargetFactory.in View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/Screen.h View 3 chunks +7 lines, -1 line 1 comment Download
M Source/core/frame/Screen.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
M Source/core/frame/Screen.idl View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +11 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/OWNERS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +4 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/ScreenOrientation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +82 lines, -0 lines 1 comment Download
A Source/modules/screen_orientation/ScreenOrientation.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +218 lines, -0 lines 4 comments Download
A Source/modules/screen_orientation/ScreenOrientation.idl View 1 chunk +15 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/ScreenOrientationClient.h View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +22 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/ScreenOrientationController.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +52 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/ScreenOrientationController.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +77 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/testing/InternalsScreenOrientation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +27 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/testing/InternalsScreenOrientation.cpp View 1 1 chunk +45 lines, -0 lines 0 comments Download
A + Source/modules/screen_orientation/testing/InternalsScreenOrientation.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -5 lines 0 comments Download
A Source/modules/screen_orientation/testing/ScreenOrientationClientMock.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
A Source/modules/screen_orientation/testing/ScreenOrientationClientMock.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +91 lines, -0 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/AssertMatchingEnums.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +7 lines, -0 lines 0 comments Download
A Source/web/ScreenOrientationClientProxy.h View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +37 lines, -0 lines 0 comments Download
A Source/web/ScreenOrientationClientProxy.cpp View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
A Source/web/WebScreenOrientationController.cpp View 19 20 21 22 23 24 25 26 1 chunk +17 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -0 lines 0 comments Download
M Source/web/web.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
A public/web/WebScreenOrientation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +21 lines, -0 lines 0 comments Download
A public/web/WebScreenOrientationClient.h View 2 3 4 5 6 7 8 9 10 11 12 1 chunk +26 lines, -0 lines 0 comments Download
A public/web/WebScreenOrientationController.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +39 lines, -0 lines 0 comments Download
M public/web/WebViewClient.h View 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
Inactive
I was working on Screen Orientation API support for blink but it has recently come ...
6 years, 10 months ago (2014-02-05 16:08:12 UTC) #1
kenneth.r.christiansen
https://codereview.chromium.org/132113006/diff/1/Source/modules/screen_orientation/ScreenOrientation.h File Source/modules/screen_orientation/ScreenOrientation.h (right): https://codereview.chromium.org/132113006/diff/1/Source/modules/screen_orientation/ScreenOrientation.h#newcode23 Source/modules/screen_orientation/ScreenOrientation.h:23: OrientationPortraitPrimary = 1, These arguments might change. Beverloo suggested ...
6 years, 10 months ago (2014-02-05 17:33:48 UTC) #2
kenneth.r.christiansen
https://codereview.chromium.org/132113006/diff/1/public/web/WebScreenOrientationClient.h File public/web/WebScreenOrientationClient.h (right): https://codereview.chromium.org/132113006/diff/1/public/web/WebScreenOrientationClient.h#newcode18 public/web/WebScreenOrientationClient.h:18: virtual void lockOrientation(WebScreenOrientations) = 0; The spec (editor draft ...
6 years, 10 months ago (2014-02-05 17:41:59 UTC) #3
Inactive
Sure, if the spec is updated to use Promises or change the argument strings, I ...
6 years, 10 months ago (2014-02-05 18:22:44 UTC) #4
abarth-chromium
miguelg is probably a good person to talked with about this topic.
6 years, 10 months ago (2014-02-05 19:14:48 UTC) #5
Miguel Garcia
On 2014/02/05 19:14:48, abarth wrote: > miguelg is probably a good person to talked with ...
6 years, 10 months ago (2014-02-06 09:36:11 UTC) #6
kenneth.r.christiansen
On 2014/02/06 09:36:11, Miguel Garcia wrote: > On 2014/02/05 19:14:48, abarth wrote: > > miguelg ...
6 years, 10 months ago (2014-02-06 15:05:13 UTC) #7
Inactive
On 2014/02/06 09:36:11, Miguel Garcia wrote: > On 2014/02/05 19:14:48, abarth wrote: > > miguelg ...
6 years, 10 months ago (2014-02-06 20:53:01 UTC) #8
mlamouri (slow - plz ping)
Some drive-by comments. https://codereview.chromium.org/132113006/diff/290001/LayoutTests/screen_orientation/screenorientation-api.html File LayoutTests/screen_orientation/screenorientation-api.html (right): https://codereview.chromium.org/132113006/diff/290001/LayoutTests/screen_orientation/screenorientation-api.html#newcode10 LayoutTests/screen_orientation/screenorientation-api.html:10: shouldBeDefined("screen.orientation"); Shouldn't you add a check ...
6 years, 10 months ago (2014-02-10 18:20:57 UTC) #9
Inactive
https://codereview.chromium.org/132113006/diff/290001/LayoutTests/screen_orientation/screenorientation-api.html File LayoutTests/screen_orientation/screenorientation-api.html (right): https://codereview.chromium.org/132113006/diff/290001/LayoutTests/screen_orientation/screenorientation-api.html#newcode10 LayoutTests/screen_orientation/screenorientation-api.html:10: shouldBeDefined("screen.orientation"); On 2014/02/10 18:20:57, Mounir Lamouri wrote: > Shouldn't ...
6 years, 10 months ago (2014-02-10 22:25:24 UTC) #10
Inactive
The patch is now complete and ready for feedback, please take a look. I hope ...
6 years, 10 months ago (2014-02-11 20:17:57 UTC) #11
kenneth.r.christiansen
https://codereview.chromium.org/132113006/diff/650001/LayoutTests/screen_orientation/lockOrientation-array-argument.html File LayoutTests/screen_orientation/lockOrientation-array-argument.html (right): https://codereview.chromium.org/132113006/diff/650001/LayoutTests/screen_orientation/lockOrientation-array-argument.html#newcode6 LayoutTests/screen_orientation/lockOrientation-array-argument.html:6: description("Validates that lockOrientation() can take an array in argument."); ...
6 years, 10 months ago (2014-02-12 13:42:36 UTC) #12
Inactive
https://codereview.chromium.org/132113006/diff/650001/LayoutTests/screen_orientation/lockOrientation-array-argument.html File LayoutTests/screen_orientation/lockOrientation-array-argument.html (right): https://codereview.chromium.org/132113006/diff/650001/LayoutTests/screen_orientation/lockOrientation-array-argument.html#newcode6 LayoutTests/screen_orientation/lockOrientation-array-argument.html:6: description("Validates that lockOrientation() can take an array in argument."); ...
6 years, 10 months ago (2014-02-12 16:03:10 UTC) #13
kenneth.r.christiansen
On 2014/02/12 16:03:10, Chris Dumez wrote: > We need to give the events a chance ...
6 years, 10 months ago (2014-02-12 16:35:45 UTC) #14
kenneth.r.christiansen
lgtm, but needs API owners review
6 years, 10 months ago (2014-02-12 16:51:03 UTC) #15
Peter Beverloo
Thanks for the patch, Chris! Hereby a few comments. https://codereview.chromium.org/132113006/diff/920001/Source/core/frame/Screen.idl File Source/core/frame/Screen.idl (right): https://codereview.chromium.org/132113006/diff/920001/Source/core/frame/Screen.idl#newcode30 Source/core/frame/Screen.idl:30: ...
6 years, 10 months ago (2014-02-12 18:19:36 UTC) #16
Inactive
https://codereview.chromium.org/132113006/diff/920001/Source/core/frame/Screen.idl File Source/core/frame/Screen.idl (right): https://codereview.chromium.org/132113006/diff/920001/Source/core/frame/Screen.idl#newcode30 Source/core/frame/Screen.idl:30: interface Screen : EventTarget { On 2014/02/12 18:19:37, Peter ...
6 years, 10 months ago (2014-02-12 19:38:36 UTC) #17
mlamouri (slow - plz ping)
The tests are great. So many of them! :) However, I am a bit concerned ...
6 years, 10 months ago (2014-02-12 20:11:25 UTC) #18
Inactive
used setTimeout(, 0) everywhere. https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html File LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html (right): https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html#newcode47 LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html:47: shouldBeFalse("screen.lockOrientation(['portrait-primary', 'invalid-orientation'])"); On 2014/02/12 20:11:26, ...
6 years, 10 months ago (2014-02-12 21:08:03 UTC) #19
kenneth.r.christiansen
> Yes, we could then initialize m_orientation to OrientationInvalid and request > the orientation from ...
6 years, 10 months ago (2014-02-13 09:40:53 UTC) #20
Inactive
https://codereview.chromium.org/132113006/diff/1280001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/132113006/diff/1280001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode14 Source/modules/screen_orientation/ScreenOrientationController.cpp:14: // FIXME: This orientation is not necessary the right ...
6 years, 10 months ago (2014-02-13 15:47:29 UTC) #21
mlamouri (slow - plz ping)
https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/locked-no-orientation-change-event.html File LayoutTests/screen_orientation/locked-no-orientation-change-event.html (right): https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/locked-no-orientation-change-event.html#newcode6 LayoutTests/screen_orientation/locked-no-orientation-change-event.html:6: description("Validates that no orientationchange event is fired when we ...
6 years, 10 months ago (2014-02-13 16:12:07 UTC) #22
Inactive
https://codereview.chromium.org/132113006/diff/920001/Source/modules/screen_orientation/ScreenOrientation.cpp File Source/modules/screen_orientation/ScreenOrientation.cpp (right): https://codereview.chromium.org/132113006/diff/920001/Source/modules/screen_orientation/ScreenOrientation.cpp#newcode188 Source/modules/screen_orientation/ScreenOrientation.cpp:188: m_orientationLockTimer.startOneShot(0); On 2014/02/13 16:12:08, Mounir Lamouri wrote: > On ...
6 years, 10 months ago (2014-02-13 16:32:25 UTC) #23
Peter Beverloo
lgtm I'd like to see a little bit more explanation in your CL's description about ...
6 years, 10 months ago (2014-02-13 16:33:41 UTC) #24
Inactive
https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/locked-no-orientation-change-event.html File LayoutTests/screen_orientation/locked-no-orientation-change-event.html (right): https://codereview.chromium.org/132113006/diff/920001/LayoutTests/screen_orientation/locked-no-orientation-change-event.html#newcode6 LayoutTests/screen_orientation/locked-no-orientation-change-event.html:6: description("Validates that no orientationchange event is fired when we ...
6 years, 10 months ago (2014-02-13 17:03:22 UTC) #25
Inactive
https://codereview.chromium.org/132113006/diff/1280001/Source/web/WebScreenOrientationController.cpp File Source/web/WebScreenOrientationController.cpp (right): https://codereview.chromium.org/132113006/diff/1280001/Source/web/WebScreenOrientationController.cpp#newcode16 Source/web/WebScreenOrientationController.cpp:16: COMPILE_ASSERT(WebScreenOrientationLandscapeSecondary == static_cast<WebScreenOrientation>(WebCore::OrientationLandscapeSecondary), WebScreenOrientationLandscapeSecondary_Is_Wrong_Should_Be_OrientationLandscapeSecondary); On 2014/02/13 17:03:24, Chris Dumez ...
6 years, 10 months ago (2014-02-13 17:06:37 UTC) #26
Inactive
https://codereview.chromium.org/132113006/diff/1280001/Source/web/WebScreenOrientationController.cpp File Source/web/WebScreenOrientationController.cpp (right): https://codereview.chromium.org/132113006/diff/1280001/Source/web/WebScreenOrientationController.cpp#newcode16 Source/web/WebScreenOrientationController.cpp:16: COMPILE_ASSERT(WebScreenOrientationLandscapeSecondary == static_cast<WebScreenOrientation>(WebCore::OrientationLandscapeSecondary), WebScreenOrientationLandscapeSecondary_Is_Wrong_Should_Be_OrientationLandscapeSecondary); On 2014/02/13 17:06:38, Chris Dumez ...
6 years, 10 months ago (2014-02-13 17:12:29 UTC) #27
Inactive
jochen and/or abarth, could you please take a look when you get a chance?
6 years, 10 months ago (2014-02-14 13:28:20 UTC) #28
abarth-chromium
not lgtm This CL is too large to review. Please break up the change into ...
6 years, 10 months ago (2014-02-15 18:44:26 UTC) #29
Inactive
On 2014/02/15 18:44:26, abarth wrote: > not lgtm > > This CL is too large ...
6 years, 10 months ago (2014-02-16 01:04:38 UTC) #30
abarth-chromium
6 years, 10 months ago (2014-02-16 20:51:08 UTC) #31
On 2014/02/16 01:04:38, Chris Dumez wrote:
> Sorry about the mess
> with DOMWindowProperty / PageLifecycleObserver / ActiveDOMObject, I
experienced
> flaky crashes in my earlier iterations and I experimented with / added them
> until I was able to get rid of the crashes.

No worries.  Now that we've fixed the lifetime issues with DOMWindow, we can
unify many of these concepts, which will make them much easier to use.  Maybe
after you finish screen orientation I'll be able to tempt you into that
refactoring project.  :)

Powered by Google App Engine
This is Rietveld 408576698