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

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: Nits Created 3 years, 7 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
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 7bad5aca77dce11ed2935931a2bf342365b596c2..89cef83f1dc1ce693ed756d641a22bf19fae53b6 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

Powered by Google App Engine
This is Rietveld 408576698