ScreenOrientation.idl 837 B

12345678910111213141516171819202122232425262728293031
  1. #import <DOM/EventHandler.idl>
  2. // https://w3c.github.io/screen-orientation/#orientationtype-enum
  3. enum OrientationType {
  4. "portrait-primary",
  5. "portrait-secondary",
  6. "landscape-primary",
  7. "landscape-secondary"
  8. };
  9. // https://w3c.github.io/screen-orientation/#orientationlocktype-enum
  10. enum OrientationLockType {
  11. "any",
  12. "natural",
  13. "landscape",
  14. "portrait",
  15. "portrait-primary",
  16. "portrait-secondary",
  17. "landscape-primary",
  18. "landscape-secondary"
  19. };
  20. // https://w3c.github.io/screen-orientation/#screenorientation-interface
  21. [Exposed=Window]
  22. interface ScreenOrientation : EventTarget {
  23. Promise<undefined> lock(OrientationLockType orientation);
  24. undefined unlock();
  25. readonly attribute OrientationType type;
  26. readonly attribute unsigned short angle;
  27. attribute EventHandler onchange;
  28. };