Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / screen_orientation / ScreenOrientation.idl
index 6fc0d5d..057ad37 100644 (file)
@@ -2,14 +2,33 @@
 // 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 {
+    readonly attribute unsigned short angle;
+    readonly attribute DOMString type;
 
-    boolean lockOrientation(sequence<DOMString> orientations);
-    boolean lockOrientation(DOMString orientation);
+    [CallWith=ScriptState] Promise lock(OrientationLockType orientation);
+    void unlock();
 
-    void unlockOrientation();
-    attribute EventHandler onorientationchange;
+    attribute EventHandler onchange;
 };