DescriptionMake 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 #Messages
Total messages: 26 (0 generated)
|