servo/tests/wpt/web-platform-tests/idle-detection/idle-detection.idl

32 lines
576 B
Text

[SecureContext]
interface mixin NavigatorIdle {
readonly attribute IdleManager idle;
};
Navigator includes NavigatorIdle;
WorkerNavigator includes NavigatorIdle;
[
SecureContext,
Exposed=(Window,Worker)
] interface IdleManager {
Promise<IdleStatus> query(optional IdleOptions options);
};
dictionary IdleOptions {
unsigned long threshold;
};
[
SecureContext,
Exposed=(Window,Worker)
] interface IdleStatus : EventTarget {
readonly attribute IdleState state;
attribute EventHandler onchange;
};
enum IdleState {
"active",
"idle",
"locked"
};