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

Unified Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp

Issue 2904263002: [Media Controls] Tests for rotate-to-fullscreen meets orientation lock (Closed)
Patch Set: Fix MSVC warning Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
index e4cfa69a1b6f0ac59bc1bfc9b031b3e0df0148b9..123f8b591e4cb51c3ce548081bbb370a31d58f47 100644
--- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
+++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
@@ -62,6 +62,12 @@ WebScreenOrientationType ScreenOrientationControllerImpl::ComputeOrientation(
bool is_tall_display = rotation % 180 ? rect.Height() < rect.Width()
: rect.Height() > rect.Width();
+
+ // https://w3c.github.io/screen-orientation/#dfn-current-orientation-angle
+ // allows the UA to associate *-primary and *-secondary values at will. Blink
+ // arbitrarily chooses rotation 0 to always be portrait-primary or
+ // landscape-primary, and portrait-primary + 90 to be landscape-primary, which
+ // together fully determine the relationship.
switch (rotation) {
case 0:
return is_tall_display ? kWebScreenOrientationPortraitPrimary
« no previous file with comments | « third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698