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

Issue 277413002: Make screen.orientation implementation use WebScreenInfo::orientationType (Closed)

Created:
6 years, 7 months ago by Inactive
Modified:
6 years, 6 months ago
CC:
blink-reviews, Peter Beverloo, abarth-chromium
Visibility:
Public.

Description

Make screen.orientation implementation use WebScreenInfo::orientationType Make screen.orientation implementation use WebScreenInfo::orientationType instead of Plaform.h's setScreenOrientationListener(). This is better because: - We can always retrieve a valid screen orientation even before the first orientationchange event is fired. i.e. there is no more initialization problem. - The orientation is specific to a Frame instead of being global. This supports environment with multiple screens. Also stop firing the 'orientationchange' event from ScreenOrientationController anymore and reuse the existing firing code in LocalFrame::sendOrientationChangeEvent() instead. This avoids firing the 'orientationchange' event twice when screen orientation is enabled. It also avoids depending on Plaform.h's setScreenOrientationListener() which is deprecated as it is global instead of per-view (i.e. lack of multi-screen support). I tested that the feature is still working on Android target using the following test app: http://jsbin.com/IJapIVE/53 R=jochen@chromium.org, mlamouri@chromium.org BUG=162827 TEST=screen_orientation/orientationchange-event-subframe.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174876

Patch Set 1 #

Patch Set 2 : Fix condition #

Patch Set 3 : Implement fallback mechanism if orientationType is undefined #

Patch Set 4 : Remove unnecessary change #

Patch Set 5 : Disable screen orientation detection in layout tests #

Total comments: 12

Patch Set 6 : Fire event on subframes as well #

Patch Set 7 : Improve test #

Total comments: 10

Patch Set 8 : Take jochen's feedback into consideration #

Patch Set 9 : Add missing DOCTYPE #

Patch Set 10 : Add FIXME comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -225 lines) Patch
A LayoutTests/screen_orientation/orientationchange-event-subframe.html View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
A LayoutTests/screen_orientation/resources/iframe-listen-orientation-change.html View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 6 7 1 chunk +13 lines, -3 lines 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientationController.h View 1 2 2 chunks +4 lines, -8 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientationController.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +41 lines, -21 lines 0 comments Download
D Source/modules/screen_orientation/ScreenOrientationDispatcher.h View 1 chunk +0 lines, -58 lines 0 comments Download
D Source/modules/screen_orientation/ScreenOrientationDispatcher.cpp View 1 chunk +0 lines, -133 lines 0 comments Download
M Source/platform/PlatformScreen.h View 2 chunks +2 lines, -0 lines 0 comments Download
M Source/platform/PlatformScreen.cpp View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
Inactive
This requires the following Chromium-side change to land first so that testRunner.setMockScreenOrientation() properly updates WebScreenInfo::orientationType. ...
6 years, 7 months ago (2014-05-12 19:41:16 UTC) #1
Inactive
On 2014/05/12 19:41:16, Chris Dumez wrote: > This requires the following Chromium-side change to land ...
6 years, 7 months ago (2014-05-12 19:49:32 UTC) #2
Inactive
Mounir, I added the fallback mechanism we discussed about when orientationType is undefined. It seems ...
6 years, 7 months ago (2014-05-13 15:11:24 UTC) #3
mlamouri (slow - plz ping)
On 2014/05/13 15:11:24, Chris Dumez wrote: > Mounir, I added the fallback mechanism we discussed ...
6 years, 7 months ago (2014-05-15 07:41:51 UTC) #4
Inactive
On 2014/05/15 07:41:51, Mounir Lamouri wrote: > On 2014/05/13 15:11:24, Chris Dumez wrote: > > ...
6 years, 7 months ago (2014-05-15 15:17:21 UTC) #5
mlamouri (slow - plz ping)
On 2014/05/15 15:17:21, Chris Dumez wrote: > On 2014/05/15 07:41:51, Mounir Lamouri wrote: > > ...
6 years, 7 months ago (2014-05-15 16:53:18 UTC) #6
mlamouri (slow - plz ping)
On 2014/05/15 16:53:18, Mounir Lamouri wrote: > I guess if you do that, you could ...
6 years, 7 months ago (2014-05-15 16:59:09 UTC) #7
Inactive
On 2014/05/15 16:59:09, Mounir Lamouri wrote: > On 2014/05/15 16:53:18, Mounir Lamouri wrote: > > ...
6 years, 7 months ago (2014-05-15 17:10:31 UTC) #8
Inactive
6 years, 7 months ago (2014-05-15 17:10:56 UTC) #9
Inactive
+eseidel instead of abarth as I heard Adam is away.
6 years, 7 months ago (2014-05-19 13:42:32 UTC) #10
mlamouri (slow - plz ping)
https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp File Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp#newcode167 Source/core/frame/LocalFrame.cpp:167: if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled()) window.orientation has a bug wrt ...
6 years, 7 months ago (2014-05-19 14:06:15 UTC) #11
Inactive
https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp File Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp#newcode167 Source/core/frame/LocalFrame.cpp:167: if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled()) On 2014/05/19 14:06:15, Mounir Lamouri ...
6 years, 7 months ago (2014-05-19 15:14:29 UTC) #12
Inactive
https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp File Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/277413002/diff/80001/Source/core/frame/LocalFrame.cpp#newcode167 Source/core/frame/LocalFrame.cpp:167: if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled()) On 2014/05/19 14:06:15, Mounir Lamouri ...
6 years, 7 months ago (2014-05-19 16:05:25 UTC) #13
mlamouri (slow - plz ping)
Changes in modules/screen_orientation/ LGTM Thanks! :) https://codereview.chromium.org/277413002/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/277413002/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode48 Source/modules/screen_orientation/ScreenOrientationController.cpp:48: return blink::WebScreenOrientationPortraitPrimary; On ...
6 years, 7 months ago (2014-05-20 20:09:25 UTC) #14
Inactive
ping review?
6 years, 7 months ago (2014-05-22 20:19:39 UTC) #15
jochen (gone - plz use gerrit)
https://codereview.chromium.org/277413002/diff/120001/LayoutTests/screen_orientation/orientationchange-event-subframe.html File LayoutTests/screen_orientation/orientationchange-event-subframe.html (right): https://codereview.chromium.org/277413002/diff/120001/LayoutTests/screen_orientation/orientationchange-event-subframe.html#newcode24 LayoutTests/screen_orientation/orientationchange-event-subframe.html:24: return (currentIndex + 1) % orientations.length; 4space indent everywhere ...
6 years, 6 months ago (2014-05-26 10:02:10 UTC) #16
Inactive
https://codereview.chromium.org/277413002/diff/120001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/277413002/diff/120001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode48 Source/modules/screen_orientation/ScreenOrientationController.cpp:48: return blink::WebScreenOrientationPortraitPrimary; On 2014/05/26 10:02:11, jochen wrote: > i ...
6 years, 6 months ago (2014-05-26 16:42:38 UTC) #17
Inactive
https://codereview.chromium.org/277413002/diff/120001/LayoutTests/screen_orientation/orientationchange-event-subframe.html File LayoutTests/screen_orientation/orientationchange-event-subframe.html (right): https://codereview.chromium.org/277413002/diff/120001/LayoutTests/screen_orientation/orientationchange-event-subframe.html#newcode24 LayoutTests/screen_orientation/orientationchange-event-subframe.html:24: return (currentIndex + 1) % orientations.length; On 2014/05/26 10:02:11, ...
6 years, 6 months ago (2014-05-27 14:22:15 UTC) #18
jochen (gone - plz use gerrit)
i guess it would be nicer if the screen info was fixed during layout tests, ...
6 years, 6 months ago (2014-05-27 15:16:18 UTC) #19
Inactive
On 2014/05/27 15:16:18, jochen wrote: > i guess it would be nicer if the screen ...
6 years, 6 months ago (2014-05-27 15:22:46 UTC) #20
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 6 months ago (2014-05-27 15:23:15 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/277413002/180001
6 years, 6 months ago (2014-05-27 15:23:23 UTC) #22
commit-bot: I haz the power
Change committed as 174876
6 years, 6 months ago (2014-05-27 16:59:33 UTC) #23
alph
FYI: Broke Oilpan compile: http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Oilpan/builds/5172
6 years, 6 months ago (2014-05-27 18:02:52 UTC) #24
Inactive
On 2014/05/27 18:02:52, alph wrote: > FYI: Broke Oilpan compile: > > http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Oilpan/builds/5172 Uploading build ...
6 years, 6 months ago (2014-05-27 18:45:04 UTC) #25
Mads Ager (chromium)
6 years, 6 months ago (2014-05-28 05:20:33 UTC) #26
Message was sent while issue was closed.
On 2014/05/27 18:45:04, Chris Dumez wrote:
> On 2014/05/27 18:02:52, alph wrote:
> > FYI: Broke Oilpan compile:
> > 
> >
>
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Oilpan/bu...
> 
> Uploading build fix at https://codereview.chromium.org/302603005

Thanks for fixing this Chris. Alexei, when gardening it is fine to ignore the
oilpan part of the waterfall. At this point they are not considered tree closers
and it is the Oilpan teams responsibility to fix it when it breaks. We *do*
appreciate any help we can get of course. :-)

Powered by Google App Engine
This is Rietveld 408576698