// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+enum OrientationLockType {
+ "any",
+ "natural",
+ "landscape",
+ "portrait",
+ "portrait-primary",
+ "portrait-secondary",
+ "landscape-primary",
+ "landscape-secondary"
+};
+
+enum OrientationType {
+ "portrait-primary",
+ "portrait-secondary",
+ "landscape-primary",
+ "landscape-secondary"
+};
+
[
+ GarbageCollected,
RuntimeEnabled=ScreenOrientation
-] partial interface Screen {
- readonly attribute DOMString orientation;
+] interface ScreenOrientation : EventTarget {
+ [MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
+ [MeasureAs=ScreenOrientationType] readonly attribute DOMString type;
- boolean lockOrientation(sequence<DOMString> orientations);
- boolean lockOrientation(DOMString orientation);
+ [CallWith=ScriptState, MeasureAs=ScreenOrientationLock] Promise lock(OrientationLockType orientation);
+ [MeasureAs=ScreenOrientationUnlock] void unlock();
- void unlockOrientation();
- attribute EventHandler onorientationchange;
+ attribute EventHandler onchange;
};