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

Unified Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 207833003: Update screen.orientation to follow the latest version of the specs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@partial_enum_callback
Patch Set: ... and mac expected results Created 6 years, 9 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: Source/modules/screen_orientation/ScreenOrientation.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp
index c3599c158db9445aea71d29f3973b8deb0c35ca1..6bf1ba750c008f061f4a73ba971e859456cd3409 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp
@@ -124,8 +124,10 @@ ScreenOrientation::~ScreenOrientation()
const AtomicString& ScreenOrientation::orientation(Screen& screen)
{
ScreenOrientation& screenOrientation = ScreenOrientation::from(screen);
- if (!screenOrientation.document())
- return emptyAtom;
+ if (!screenOrientation.document()) {
+ // FIXME: we should try to return a better guess, like the latest known value.
+ return orientationToString(blink::WebScreenOrientationPortraitPrimary);
+ }
ScreenOrientationController& controller = ScreenOrientationController::from(*screenOrientation.document());
return orientationToString(controller.orientation());
}

Powered by Google App Engine
This is Rietveld 408576698