Skip to content

Commit

Permalink
Update the screen-orientation IDL + tests (#11899)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebjerring authored Jul 12, 2018
1 parent 0347d5a commit b7f4f1d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 47 deletions.
40 changes: 21 additions & 19 deletions interfaces/screen-orientation.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@
// See: https://w3c.github.io/screen-orientation/

partial interface Screen {
[SameObject]
readonly attribute ScreenOrientation orientation;
[SameObject] readonly attribute ScreenOrientation orientation;
};

[Exposed=Window]
interface ScreenOrientation : EventTarget {
Promise<void> lock(OrientationLockType orientation);
void unlock();
readonly attribute OrientationType type;
readonly attribute unsigned short angle;
attribute EventHandler onchange;
Promise<void> lock(OrientationLockType orientation);
void unlock();
readonly attribute OrientationType type;
readonly attribute unsigned short angle;
attribute EventHandler onchange;
};

enum OrientationType {
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
};

enum OrientationLockType {
"any",
"natural",
"landscape",
"portrait",
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
"any",
"natural",
"landscape",
"portrait",
"portrait-primary",
"portrait-secondary",
"landscape-primary",
"landscape-secondary"
};
18 changes: 18 additions & 0 deletions screen-orientation/idlharness.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

'use strict';

// https://w3c.github.io/screen-orientation/

idl_test(
['screen-orientation'],
['dom', 'cssom-view', 'html'],
idl_array => {
idl_array.add_objects({
Screen: ['screen'],
ScreenOrientation: ['screen.orientation']
});
},
'Test IDL implementation of Screen Orientation API'
);
28 changes: 0 additions & 28 deletions screen-orientation/interfaces.html

This file was deleted.

0 comments on commit b7f4f1d

Please sign in to comment.