2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-03-31 08:42:20 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2012-10-16 15:51:00 +04:00
|
|
|
* http://dom.spec.whatwg.org/#element and
|
|
|
|
* http://domparsing.spec.whatwg.org/ and
|
|
|
|
* http://dev.w3.org/csswg/cssom-view/ and
|
|
|
|
* http://www.w3.org/TR/selectors-api/
|
2012-03-31 08:42:20 +04:00
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2022-02-17 19:22:58 +03:00
|
|
|
interface nsIScreen;
|
|
|
|
|
2023-09-28 22:40:50 +03:00
|
|
|
[Exposed=Window,
|
|
|
|
InstrumentedProps=(computedStyleMap,onmousewheel,scrollIntoViewIfNeeded)]
|
2012-03-31 08:42:20 +04:00
|
|
|
interface Element : Node {
|
2016-04-13 15:21:12 +03:00
|
|
|
[Constant]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute DOMString? namespaceURI;
|
2016-04-13 15:21:12 +03:00
|
|
|
[Constant]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute DOMString? prefix;
|
2016-04-13 15:21:12 +03:00
|
|
|
[Constant]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute DOMString localName;
|
2016-04-13 15:21:12 +03:00
|
|
|
|
2012-12-26 02:00:15 +04:00
|
|
|
// Not [Constant] because it depends on which document we're in
|
2013-01-30 02:53:53 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute DOMString tagName;
|
|
|
|
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
attribute DOMString id;
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
attribute DOMString className;
|
2016-02-12 01:50:42 +03:00
|
|
|
[Constant, PutForwards=value]
|
2014-05-30 11:36:53 +04:00
|
|
|
readonly attribute DOMTokenList classList;
|
2012-03-31 08:42:20 +04:00
|
|
|
|
2019-10-13 12:40:08 +03:00
|
|
|
// https://drafts.csswg.org/css-shadow-parts/#idl
|
2020-08-11 08:54:17 +03:00
|
|
|
[SameObject, PutForwards=value]
|
2019-10-13 12:40:08 +03:00
|
|
|
readonly attribute DOMTokenList part;
|
|
|
|
|
2013-08-29 08:30:05 +04:00
|
|
|
[SameObject]
|
2014-08-25 13:25:34 +04:00
|
|
|
readonly attribute NamedNodeMap attributes;
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2015-12-03 00:04:53 +03:00
|
|
|
sequence<DOMString> getAttributeNames();
|
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
DOMString? getAttribute(DOMString name);
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
|
2017-12-21 01:43:18 +03:00
|
|
|
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
|
2018-07-03 22:12:49 +03:00
|
|
|
boolean toggleAttribute(DOMString name, optional boolean force);
|
|
|
|
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setAttribute(DOMString name, DOMString value);
|
2017-12-21 01:43:18 +03:00
|
|
|
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined removeAttribute(DOMString name);
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined removeAttributeNS(DOMString? namespace, DOMString localName);
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
boolean hasAttribute(DOMString name);
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
|
2014-10-01 12:16:00 +04:00
|
|
|
[Pure]
|
|
|
|
boolean hasAttributes();
|
2012-03-31 08:42:20 +04:00
|
|
|
|
2014-09-13 17:08:00 +04:00
|
|
|
[Throws, Pure]
|
2020-12-23 08:42:00 +03:00
|
|
|
Element? closest(UTF8String selector);
|
2014-09-13 17:08:00 +04:00
|
|
|
|
2014-08-02 07:37:09 +04:00
|
|
|
[Throws, Pure]
|
2020-12-23 08:42:00 +03:00
|
|
|
boolean matches(UTF8String selector);
|
2015-10-20 03:18:09 +03:00
|
|
|
[Throws, Pure, BinaryName="matches"]
|
2020-12-23 08:42:00 +03:00
|
|
|
boolean webkitMatchesSelector(UTF8String selector);
|
2014-08-02 07:37:09 +04:00
|
|
|
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2012-10-16 15:51:00 +04:00
|
|
|
HTMLCollection getElementsByTagName(DOMString localName);
|
2013-12-02 18:50:34 +04:00
|
|
|
[Throws, Pure]
|
2012-10-16 15:51:00 +04:00
|
|
|
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
2013-11-26 05:59:39 +04:00
|
|
|
[Pure]
|
2012-10-16 15:51:00 +04:00
|
|
|
HTMLCollection getElementsByClassName(DOMString classNames);
|
2019-11-21 04:45:51 +03:00
|
|
|
|
2020-02-04 16:35:43 +03:00
|
|
|
[CEReactions, Throws]
|
2016-03-28 11:42:57 +03:00
|
|
|
Element? insertAdjacentElement(DOMString where, Element element); // historical
|
|
|
|
|
|
|
|
[Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined insertAdjacentText(DOMString where, DOMString data); // historical
|
2016-03-28 11:42:57 +03:00
|
|
|
|
2013-07-02 18:04:27 +04:00
|
|
|
/**
|
|
|
|
* The ratio of font-size-inflated text font size to computed font
|
|
|
|
* size for this element. This will query the element for its primary frame,
|
|
|
|
* and then use this to get font size inflation information about the frame.
|
|
|
|
* This will be 1.0 if font size inflation is not enabled, and -1.0 if an
|
|
|
|
* error occurred during the retrieval of the font size inflation.
|
|
|
|
*
|
|
|
|
* @note The font size inflation ratio that is returned is actually the
|
|
|
|
* font size inflation data for the element's _primary frame_, not the
|
|
|
|
* element itself, but for most purposes, this should be sufficient.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute float fontSizeInflation;
|
|
|
|
|
2020-03-18 12:21:44 +03:00
|
|
|
/**
|
|
|
|
* Returns the pseudo-element string if this element represents a
|
|
|
|
* pseudo-element, or null otherwise.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute DOMString? implementedPseudoElement;
|
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// Selectors API
|
|
|
|
/**
|
|
|
|
* Returns whether this element would be selected by the given selector
|
|
|
|
* string.
|
|
|
|
*
|
|
|
|
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
|
|
|
|
*/
|
2015-10-20 03:18:09 +03:00
|
|
|
[Throws, Pure, BinaryName="matches"]
|
2020-12-23 08:42:00 +03:00
|
|
|
boolean mozMatchesSelector(UTF8String selector);
|
2012-10-16 15:51:00 +04:00
|
|
|
|
2014-04-04 21:09:10 +04:00
|
|
|
// Pointer events methods.
|
2021-04-27 22:19:03 +03:00
|
|
|
[UseCounter, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setPointerCapture(long pointerId);
|
2021-04-27 22:19:03 +03:00
|
|
|
[UseCounter, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined releasePointerCapture(long pointerId);
|
2016-08-10 10:31:43 +03:00
|
|
|
boolean hasPointerCapture(long pointerId);
|
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// Proprietary extensions
|
|
|
|
/**
|
|
|
|
* Set this during a mousedown event to grab and retarget all mouse events
|
|
|
|
* to this element until the mouse button is released or releaseCapture is
|
|
|
|
* called. If retargetToElement is true, then all events are targetted at
|
|
|
|
* this element. If false, events can also fire at descendants of this
|
|
|
|
* element.
|
2017-11-16 00:20:35 +03:00
|
|
|
*
|
2012-10-16 15:51:00 +04:00
|
|
|
*/
|
2021-04-26 22:37:45 +03:00
|
|
|
[Deprecated=ElementSetCapture, Pref="dom.mouse_capture.enabled"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setCapture(optional boolean retargetToElement = false);
|
2012-10-16 15:51:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If this element has captured the mouse, release the capture. If another
|
|
|
|
* element has captured the mouse, this method has no effect.
|
|
|
|
*/
|
2021-04-26 22:37:45 +03:00
|
|
|
[Deprecated=ElementReleaseCapture, Pref="dom.mouse_capture.enabled"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined releaseCapture();
|
2012-10-16 15:51:00 +04:00
|
|
|
|
2016-11-17 17:56:43 +03:00
|
|
|
/*
|
|
|
|
* Chrome-only version of setCapture that works outside of a mousedown event.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setCaptureAlways(optional boolean retargetToElement = false);
|
2016-11-17 17:56:43 +03:00
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// Mozilla extensions
|
|
|
|
|
|
|
|
// Obsolete methods.
|
2013-04-09 19:29:47 +04:00
|
|
|
Attr? getAttributeNode(DOMString name);
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Throws]
|
2013-04-09 19:29:47 +04:00
|
|
|
Attr? setAttributeNode(Attr newAttr);
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Throws]
|
2013-04-09 19:29:47 +04:00
|
|
|
Attr? removeAttributeNode(Attr oldAttr);
|
|
|
|
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
|
2017-06-29 17:25:00 +03:00
|
|
|
[CEReactions, Throws]
|
2013-04-09 19:29:47 +04:00
|
|
|
Attr? setAttributeNodeNS(Attr newAttr);
|
2013-09-30 21:32:02 +04:00
|
|
|
|
2019-06-18 01:51:33 +03:00
|
|
|
[Func="nsContentUtils::IsCallerChromeOrElementTransformGettersEnabled"]
|
2017-05-30 19:42:25 +03:00
|
|
|
DOMMatrixReadOnly getTransformToAncestor(Element ancestor);
|
2019-06-18 01:51:33 +03:00
|
|
|
[Func="nsContentUtils::IsCallerChromeOrElementTransformGettersEnabled"]
|
2017-05-30 19:42:25 +03:00
|
|
|
DOMMatrixReadOnly getTransformToParent();
|
2019-06-18 01:51:33 +03:00
|
|
|
[Func="nsContentUtils::IsCallerChromeOrElementTransformGettersEnabled"]
|
2017-05-30 19:42:25 +03:00
|
|
|
DOMMatrixReadOnly getTransformToViewport();
|
2012-10-16 15:51:00 +04:00
|
|
|
};
|
|
|
|
|
2019-04-12 11:16:47 +03:00
|
|
|
// https://html.spec.whatwg.org/#focus-management-apis
|
|
|
|
dictionary FocusOptions {
|
|
|
|
boolean preventScroll = false;
|
2022-07-12 01:04:34 +03:00
|
|
|
boolean focusVisible;
|
2019-04-12 11:16:47 +03:00
|
|
|
};
|
|
|
|
|
2019-09-06 10:46:46 +03:00
|
|
|
interface mixin HTMLOrForeignElement {
|
|
|
|
[SameObject] readonly attribute DOMStringMap dataset;
|
|
|
|
// See bug 1389421
|
|
|
|
// attribute DOMString nonce; // intentionally no [CEReactions]
|
|
|
|
|
2022-12-19 18:09:15 +03:00
|
|
|
[CEReactions, SetterThrows, Pure] attribute boolean autofocus;
|
2019-09-06 10:46:46 +03:00
|
|
|
[CEReactions, SetterThrows, Pure] attribute long tabIndex;
|
2022-09-21 10:44:58 +03:00
|
|
|
[Throws, NeedsCallerType] undefined focus(optional FocusOptions options = {});
|
|
|
|
[Throws] undefined blur();
|
2019-04-12 11:16:47 +03:00
|
|
|
};
|
|
|
|
|
2019-09-06 22:34:55 +03:00
|
|
|
// https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-mixin
|
|
|
|
interface mixin ElementCSSInlineStyle {
|
|
|
|
[SameObject, PutForwards=cssText]
|
|
|
|
readonly attribute CSSStyleDeclaration style;
|
|
|
|
};
|
|
|
|
|
Bug 1045754 - Part 1 - Implement updated CSSOM-View smooth-scrolling specification. r=bz
- Added new WebIDL dictionary, ScrollToOptions. This dictionary extends
ScrollOptions by adding "left" and "top", specifying the scroll offset.
This will be later extended with more members to allow scroll offsets to be
specified with logical axes.
- Implemented Window.Scroll, Window.ScrollTo, Window.ScrollBy, Element.Scroll,
Element.ScrollTo, and Element.ScrollBy functions that accept ScrollToOptions
as a single parameter.
- Removed ScrollOptions dictionary parameter from existing Window.Scroll,
Window.ScrollTo, and Window.ScrollBy functions as these have been replaced
with functions accepting a single parameter, ScrollToOptions.
- Added new WebIDL dictionary, ScrollIntoViewOptions. This dictionary
extends ScrollOptions by adding "block", specifying whether the element
start or end will be scrolled into view.
- Replaced Element.ScrollIntoView(bool,ScrollOptions) with
Element.ScrollIntoView(ScrollIntoViewOptions) to match updated
CSSOM-View scroll-behavior specification.
2014-10-01 21:47:56 +04:00
|
|
|
// http://dev.w3.org/csswg/cssom-view/
|
2017-09-28 23:57:24 +03:00
|
|
|
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
|
Bug 1045754 - Part 1 - Implement updated CSSOM-View smooth-scrolling specification. r=bz
- Added new WebIDL dictionary, ScrollToOptions. This dictionary extends
ScrollOptions by adding "left" and "top", specifying the scroll offset.
This will be later extended with more members to allow scroll offsets to be
specified with logical axes.
- Implemented Window.Scroll, Window.ScrollTo, Window.ScrollBy, Element.Scroll,
Element.ScrollTo, and Element.ScrollBy functions that accept ScrollToOptions
as a single parameter.
- Removed ScrollOptions dictionary parameter from existing Window.Scroll,
Window.ScrollTo, and Window.ScrollBy functions as these have been replaced
with functions accepting a single parameter, ScrollToOptions.
- Added new WebIDL dictionary, ScrollIntoViewOptions. This dictionary
extends ScrollOptions by adding "block", specifying whether the element
start or end will be scrolled into view.
- Replaced Element.ScrollIntoView(bool,ScrollOptions) with
Element.ScrollIntoView(ScrollIntoViewOptions) to match updated
CSSOM-View scroll-behavior specification.
2014-10-01 21:47:56 +04:00
|
|
|
dictionary ScrollIntoViewOptions : ScrollOptions {
|
|
|
|
ScrollLogicalPosition block = "start";
|
2017-09-28 23:57:24 +03:00
|
|
|
ScrollLogicalPosition inline = "nearest";
|
Bug 1045754 - Part 1 - Implement updated CSSOM-View smooth-scrolling specification. r=bz
- Added new WebIDL dictionary, ScrollToOptions. This dictionary extends
ScrollOptions by adding "left" and "top", specifying the scroll offset.
This will be later extended with more members to allow scroll offsets to be
specified with logical axes.
- Implemented Window.Scroll, Window.ScrollTo, Window.ScrollBy, Element.Scroll,
Element.ScrollTo, and Element.ScrollBy functions that accept ScrollToOptions
as a single parameter.
- Removed ScrollOptions dictionary parameter from existing Window.Scroll,
Window.ScrollTo, and Window.ScrollBy functions as these have been replaced
with functions accepting a single parameter, ScrollToOptions.
- Added new WebIDL dictionary, ScrollIntoViewOptions. This dictionary
extends ScrollOptions by adding "block", specifying whether the element
start or end will be scrolled into view.
- Replaced Element.ScrollIntoView(bool,ScrollOptions) with
Element.ScrollIntoView(ScrollIntoViewOptions) to match updated
CSSOM-View scroll-behavior specification.
2014-10-01 21:47:56 +04:00
|
|
|
};
|
|
|
|
|
2022-08-22 20:28:04 +03:00
|
|
|
dictionary CheckVisibilityOptions {
|
|
|
|
boolean checkOpacity = false;
|
|
|
|
boolean checkVisibilityCSS = false;
|
2023-12-12 15:39:23 +03:00
|
|
|
boolean contentVisibilityAuto = false;
|
|
|
|
boolean opacityProperty = false;
|
|
|
|
boolean visibilityProperty = false;
|
2022-08-22 20:28:04 +03:00
|
|
|
[ChromeOnly] boolean flush = true;
|
|
|
|
};
|
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
|
|
|
|
partial interface Element {
|
2013-09-20 14:21:03 +04:00
|
|
|
DOMRectList getClientRects();
|
|
|
|
DOMRect getBoundingClientRect();
|
2012-10-16 15:51:00 +04:00
|
|
|
|
2022-08-22 20:28:04 +03:00
|
|
|
boolean checkVisibility(optional CheckVisibilityOptions options = {});
|
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// scrolling
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
|
2013-01-30 02:53:53 +04:00
|
|
|
// None of the CSSOM attributes are [Pure], because they flush
|
2012-10-16 15:51:00 +04:00
|
|
|
attribute long scrollTop; // scroll on setting
|
|
|
|
attribute long scrollLeft; // scroll on setting
|
|
|
|
readonly attribute long scrollWidth;
|
|
|
|
readonly attribute long scrollHeight;
|
2017-11-16 00:20:35 +03:00
|
|
|
|
2024-02-08 14:13:00 +03:00
|
|
|
[BinaryName="scrollTo"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined scroll(unrestricted double x, unrestricted double y);
|
2024-02-08 14:13:00 +03:00
|
|
|
[BinaryName="scrollTo"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined scroll(optional ScrollToOptions options = {});
|
|
|
|
undefined scrollTo(unrestricted double x, unrestricted double y);
|
|
|
|
undefined scrollTo(optional ScrollToOptions options = {});
|
|
|
|
undefined scrollBy(unrestricted double x, unrestricted double y);
|
|
|
|
undefined scrollBy(optional ScrollToOptions options = {});
|
2015-02-20 03:03:07 +03:00
|
|
|
// mozScrollSnap is used by chrome to perform scroll snapping after the
|
|
|
|
// user performs actions that may affect scroll position
|
|
|
|
// mozScrollSnap is deprecated, to be replaced by a web accessible API, such
|
|
|
|
// as an extension to the ScrollOptions dictionary. See bug 1137937.
|
2022-09-21 10:44:58 +03:00
|
|
|
[ChromeOnly] undefined mozScrollSnap();
|
2012-10-16 15:51:00 +04:00
|
|
|
|
|
|
|
readonly attribute long clientTop;
|
|
|
|
readonly attribute long clientLeft;
|
|
|
|
readonly attribute long clientWidth;
|
|
|
|
readonly attribute long clientHeight;
|
|
|
|
|
2022-02-17 19:22:58 +03:00
|
|
|
// Return the screen coordinates of the element, in CSS pixels relative to
|
|
|
|
// the window's screen.
|
|
|
|
[ChromeOnly] readonly attribute long screenX;
|
|
|
|
[ChromeOnly] readonly attribute long screenY;
|
|
|
|
[ChromeOnly] readonly attribute nsIScreen? screen;
|
|
|
|
|
2012-10-16 15:51:00 +04:00
|
|
|
// Mozilla specific stuff
|
2015-10-27 07:38:02 +03:00
|
|
|
/* The minimum/maximum offset that the element can be scrolled to
|
2012-10-16 15:51:00 +04:00
|
|
|
(i.e., the value that scrollLeft/scrollTop would be clamped to if they were
|
|
|
|
set to arbitrarily large values. */
|
2015-10-27 07:38:02 +03:00
|
|
|
[ChromeOnly] readonly attribute long scrollTopMin;
|
|
|
|
readonly attribute long scrollTopMax;
|
|
|
|
[ChromeOnly] readonly attribute long scrollLeftMin;
|
|
|
|
readonly attribute long scrollLeftMax;
|
2012-10-16 15:51:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
|
|
|
|
partial interface Element {
|
2019-03-02 07:22:05 +03:00
|
|
|
[CEReactions, SetterNeedsSubjectPrincipal=NonSystem, Pure, SetterThrows, GetterCanOOM]
|
2021-04-11 06:13:32 +03:00
|
|
|
attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
2019-03-02 07:22:05 +03:00
|
|
|
[CEReactions, Pure, SetterThrows]
|
2021-04-11 06:13:32 +03:00
|
|
|
attribute [LegacyNullToEmptyString] DOMString outerHTML;
|
2017-06-29 17:27:00 +03:00
|
|
|
[CEReactions, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined insertAdjacentHTML(DOMString position, DOMString text);
|
2012-10-16 15:51:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// http://www.w3.org/TR/selectors-api/#interface-definitions
|
|
|
|
partial interface Element {
|
2013-12-02 18:50:34 +04:00
|
|
|
[Throws, Pure]
|
2020-12-23 08:42:00 +03:00
|
|
|
Element? querySelector(UTF8String selectors);
|
2013-12-02 18:50:34 +04:00
|
|
|
[Throws, Pure]
|
2020-12-23 08:42:00 +03:00
|
|
|
NodeList querySelectorAll(UTF8String selectors);
|
2012-03-31 08:42:20 +04:00
|
|
|
};
|
2013-04-13 11:08:47 +04:00
|
|
|
|
2017-10-19 09:44:35 +03:00
|
|
|
// https://dom.spec.whatwg.org/#dictdef-shadowrootinit
|
|
|
|
dictionary ShadowRootInit {
|
|
|
|
required ShadowRootMode mode;
|
2021-09-07 18:01:34 +03:00
|
|
|
boolean delegatesFocus = false;
|
2021-07-20 21:06:25 +03:00
|
|
|
SlotAssignmentMode slotAssignment = "named";
|
2023-12-08 00:27:10 +03:00
|
|
|
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
2023-12-08 00:27:09 +03:00
|
|
|
boolean clonable = false;
|
2017-10-19 09:44:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://dom.spec.whatwg.org/#element
|
2013-12-02 14:26:11 +04:00
|
|
|
partial interface Element {
|
2017-10-19 09:44:35 +03:00
|
|
|
// Shadow DOM v1
|
2018-11-28 18:11:38 +03:00
|
|
|
[Throws, UseCounter]
|
2017-10-19 09:44:35 +03:00
|
|
|
ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict);
|
2018-11-15 09:51:07 +03:00
|
|
|
[BinaryName="shadowRootByMode"]
|
2013-12-02 14:26:11 +04:00
|
|
|
readonly attribute ShadowRoot? shadowRoot;
|
2018-02-03 13:15:25 +03:00
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
[Func="Document::IsCallerChromeOrAddon", BinaryName="shadowRoot"]
|
2018-02-03 13:15:25 +03:00
|
|
|
readonly attribute ShadowRoot? openOrClosedShadowRoot;
|
|
|
|
|
2018-11-15 09:51:07 +03:00
|
|
|
[BinaryName="assignedSlotByMode"]
|
2017-10-19 09:31:36 +03:00
|
|
|
readonly attribute HTMLSlotElement? assignedSlot;
|
2018-07-14 04:48:19 +03:00
|
|
|
|
2018-11-15 09:51:07 +03:00
|
|
|
[ChromeOnly, BinaryName="assignedSlot"]
|
2018-07-14 04:48:19 +03:00
|
|
|
readonly attribute HTMLSlotElement? openOrClosedAssignedSlot;
|
|
|
|
|
2018-11-15 09:51:07 +03:00
|
|
|
[CEReactions, Unscopable, SetterThrows]
|
2017-10-19 09:44:35 +03:00
|
|
|
attribute DOMString slot;
|
2013-12-02 14:26:11 +04:00
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Element includes ChildNode;
|
|
|
|
Element includes NonDocumentTypeChildNode;
|
|
|
|
Element includes ParentNode;
|
|
|
|
Element includes Animatable;
|
|
|
|
Element includes GeometryUtils;
|
2020-04-22 14:32:01 +03:00
|
|
|
Element includes AccessibilityRole;
|
2020-04-22 14:32:18 +03:00
|
|
|
Element includes AriaAttributes;
|
2014-07-09 23:30:22 +04:00
|
|
|
|
2016-02-17 03:47:11 +03:00
|
|
|
// https://fullscreen.spec.whatwg.org/#api
|
|
|
|
partial interface Element {
|
2022-05-02 10:44:24 +03:00
|
|
|
[NewObject, NeedsCallerType]
|
2022-09-21 10:44:58 +03:00
|
|
|
Promise<undefined> requestFullscreen();
|
2022-05-02 10:44:24 +03:00
|
|
|
[NewObject, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"]
|
2022-09-21 10:44:58 +03:00
|
|
|
Promise<undefined> mozRequestFullScreen();
|
2018-09-14 03:06:16 +03:00
|
|
|
|
|
|
|
// Events handlers
|
|
|
|
attribute EventHandler onfullscreenchange;
|
|
|
|
attribute EventHandler onfullscreenerror;
|
2016-02-17 03:47:11 +03:00
|
|
|
};
|
2016-07-28 10:15:21 +03:00
|
|
|
|
|
|
|
// https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
|
|
|
|
partial interface Element {
|
2018-08-31 01:55:31 +03:00
|
|
|
[NeedsCallerType, Pref="dom.pointer-lock.enabled"]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined requestPointerLock();
|
2016-07-28 10:15:21 +03:00
|
|
|
};
|
2018-08-01 21:52:21 +03:00
|
|
|
|
|
|
|
// Mozilla-specific additions to support devtools
|
|
|
|
partial interface Element {
|
|
|
|
// Support reporting of Flexbox properties
|
|
|
|
/**
|
|
|
|
* If this element has a display:flex or display:inline-flex style,
|
|
|
|
* this property returns an object with computed values for flex
|
|
|
|
* properties, as well as a property that exposes the flex lines
|
|
|
|
* in this container.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
|
|
|
Flex? getAsFlexContainer();
|
|
|
|
|
|
|
|
// Support reporting of Grid properties
|
|
|
|
/**
|
|
|
|
* If this element has a display:grid or display:inline-grid style,
|
|
|
|
* this property returns an object with computed values for grid
|
|
|
|
* tracks and lines.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
|
|
|
sequence<Grid> getGridFragments();
|
2019-11-21 04:45:51 +03:00
|
|
|
|
2020-04-21 21:46:35 +03:00
|
|
|
/**
|
|
|
|
* Returns whether there are any grid fragments on this element.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
|
|
|
boolean hasGridFragments();
|
|
|
|
|
2018-08-01 21:52:21 +03:00
|
|
|
/**
|
|
|
|
* Returns a sequence of all the descendent elements of this element
|
|
|
|
* that have display:grid or display:inline-grid style and generate
|
|
|
|
* a frame.
|
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
|
|
|
sequence<Element> getElementsWithGrid();
|
2019-11-21 04:45:51 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set attribute on the Element with a customized Content-Security-Policy
|
|
|
|
* appropriate to devtools, which includes:
|
|
|
|
* style-src 'unsafe-inline'
|
|
|
|
*/
|
|
|
|
[ChromeOnly, CEReactions, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setAttributeDevtools(DOMString name, DOMString value);
|
2019-11-21 04:45:51 +03:00
|
|
|
[ChromeOnly, CEReactions, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setAttributeDevtoolsNS(DOMString? namespace, DOMString name, DOMString value);
|
2020-10-10 04:39:55 +03:00
|
|
|
|
2020-08-29 01:17:56 +03:00
|
|
|
/**
|
|
|
|
* Provide a direct way to determine if this Element has visible
|
|
|
|
* scrollbars. Flushes layout.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute boolean hasVisibleScrollbars;
|
2018-08-01 21:52:21 +03:00
|
|
|
};
|
2019-05-09 21:26:17 +03:00
|
|
|
|
|
|
|
// These variables are used in vtt.js, they are used for positioning vtt cues.
|
|
|
|
partial interface Element {
|
|
|
|
// These two attributes are a double version of the clientHeight and the
|
|
|
|
// clientWidth.
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute double clientHeightDouble;
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute double clientWidthDouble;
|
2019-05-09 22:22:33 +03:00
|
|
|
// This attribute returns the block size of the first line box under the different
|
|
|
|
// writing directions. If the direction is horizontal, it represents box's
|
|
|
|
// height. If the direction is vertical, it represents box's width.
|
|
|
|
[ChromeOnly]
|
|
|
|
readonly attribute double firstLineBoxBSize;
|
2019-05-09 21:26:17 +03:00
|
|
|
};
|
2021-09-20 14:10:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
// Sanitizer API, https://wicg.github.io/sanitizer-api/
|
|
|
|
dictionary SetHTMLOptions {
|
2023-11-28 14:04:03 +03:00
|
|
|
SanitizerConfig sanitizer;
|
2021-09-20 14:10:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
partial interface Element {
|
2022-12-19 18:56:35 +03:00
|
|
|
[SecureContext, UseCounter, Throws, Pref="dom.security.setHTML.enabled"]
|
|
|
|
undefined setHTML(DOMString aInnerHTML, optional SetHTMLOptions options = {});
|
2021-09-20 14:10:22 +03:00
|
|
|
};
|
2023-12-08 00:27:10 +03:00
|
|
|
|
|
|
|
partial interface Element {
|
2023-12-08 00:27:10 +03:00
|
|
|
// https://html.spec.whatwg.org/#dom-element-sethtmlunsafe
|
|
|
|
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
2023-12-08 00:27:10 +03:00
|
|
|
undefined setHTMLUnsafe(DOMString html);
|
|
|
|
};
|