// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://dom.spec.whatwg.org/#mixin-documentorshadowroot
// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
[
    LegacyTreatAsPartialInterface,
    NoInterfaceObject
] interface DocumentOrShadowRoot {
    // Selection API
    // https://w3c.github.io/selection-api/#extensions-to-document-interface
    Selection? getSelection();
    // CSSOM View Module
    // https://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
    // TODO(foolip): The x and y arguments should be of type double.
    Element? elementFromPoint(long x, long y);
    sequence<Element> elementsFromPoint(long x, long y);
    readonly attribute Element? activeElement;
    [SameObject] readonly attribute StyleSheetList styleSheets;
    // PointerLock API
    // https://w3c.github.io/pointerlock/
    readonly attribute Element? pointerLockElement;
    // Fullscreen API
    // https://fullscreen.spec.whatwg.org/
    [RuntimeEnabled=FullscreenUnprefixed] readonly attribute Element? fullscreenElement;
};
