1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
/*
* Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
// https://drafts.csswg.org/cssom-view/#dictdef-checkvisibilityoptions
dictionary CheckVisibilityOptions {
boolean checkOpacity = false;
boolean checkVisibilityCSS = false;
[RuntimeEnabled=CheckVisibilityExtraProperties] boolean contentVisibilityAuto = false;
[RuntimeEnabled=CheckVisibilityExtraProperties] boolean opacityProperty = false;
[RuntimeEnabled=CheckVisibilityExtraProperties] boolean visibilityProperty = false;
};
// Options dictionary for setHTML and setHTMLUnsafe.
// See: https://wicg.github.io/sanitizer-api/#configobject
enum SanitizerPresets { "default" };
dictionary SetHTMLOptions {
(Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = "default";
};
dictionary SetHTMLUnsafeOptions {
(Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = {};
};
// https://dom.spec.whatwg.org/#interface-element
[
Exposed=Window
] interface Element : Node {
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
readonly attribute DOMString tagName;
[CEReactions, Reflect] attribute DOMString id;
[CEReactions, Reflect=class] attribute DOMString className;
[SameObject, PerWorldBindings, PutForwards=value] readonly attribute DOMTokenList classList;
[Unscopable, CEReactions, Reflect] attribute DOMString slot;
[Affects=Nothing] boolean hasAttributes();
[SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
[Affects=Nothing, ImplementedAs=getAttributeNamesForBindings] sequence<DOMString> getAttributeNames();
[Affects=Nothing] DOMString? getAttribute(DOMString name);
[Affects=Nothing] DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
[RaisesException, CEReactions] void setAttribute(DOMString name, DOMString value);
[RaisesException, CEReactions] void setAttribute(DOMString name, TrustedType value);
[RaisesException, CEReactions] void setAttributeNS(DOMString? namespaceURI, DOMString name, DOMString value);
[RaisesException, CEReactions] void setAttributeNS(DOMString? namespaceURI, DOMString name, TrustedType value);
[CEReactions] void removeAttribute(DOMString name);
[CEReactions] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
[RaisesException, CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
[Affects=Nothing] boolean hasAttribute(DOMString name);
[Affects=Nothing] boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
Attr? getAttributeNode(DOMString name);
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
[RaisesException, CEReactions] Attr? setAttributeNode(Attr attr);
[RaisesException, CEReactions] Attr? setAttributeNodeNS(Attr attr);
[RaisesException, CEReactions] Attr removeAttributeNode(Attr attr);
[RaisesException, MeasureAs=ElementAttachShadow] ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict);
[PerWorldBindings, ImplementedAs=OpenShadowRoot] readonly attribute ShadowRoot? shadowRoot;
[RaisesException] Element? closest(DOMString selectors);
[RaisesException] boolean matches(DOMString selectors);
[RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors); // historical alias of .matches
[Affects=Nothing] HTMLCollection getElementsByTagName(DOMString localName);
[Affects=Nothing] HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
[Affects=Nothing] HTMLCollection getElementsByClassName(DOMString classNames);
[RaisesException, CEReactions] Element? insertAdjacentElement(DOMString where, Element element);
[RaisesException] void insertAdjacentText(DOMString where, DOMString data);
// CSS Shadow Parts
// https://drafts.csswg.org/css-shadow-parts/#idl
[SameObject, PerWorldBindings, PutForwards=value] readonly attribute DOMTokenList part;
// Pointer Events
// https://w3c.github.io/pointerevents/#extensions-to-the-element-interface
[RaisesException] void setPointerCapture (long pointerId);
[RaisesException] void releasePointerCapture (long pointerId);
boolean hasPointerCapture (long pointerId);
// Mixin Slotable
// https://dom.spec.whatwg.org/#mixin-slotable
[ImplementedAs=assignedSlotForBinding] readonly attribute HTMLSlotElement? assignedSlot;
// DOM Parsing and Serialization
// https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
[CEReactions, RuntimeCallStatsCounter=ElementInnerHTML, RaisesException=Setter] attribute [LegacyNullToEmptyString, StringContext=TrustedHTML] DOMString innerHTML;
[CEReactions, RaisesException=Setter] attribute [LegacyNullToEmptyString, StringContext=TrustedHTML] DOMString outerHTML;
[CEReactions, RaisesException] void insertAdjacentHTML(DOMString position, HTMLString text);
// https://github.com/whatwg/html/pull/9538
[RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString html);
// https://wicg.github.io/sanitizer-api/#sanitizer-api
// TODO(vogelheim): Merge the two setHTMLUnsafe variants into one, once the
// different RuntimeEnabled flags are both perma-enabled.
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString html, SetHTMLUnsafeOptions options);
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, optional SetHTMLOptions options = {});
// Declarative Shadow DOM getHTML() function.
[Affects=Nothing, MeasureAs=ElementGetHTML, RaisesException] DOMString getHTML(optional GetHTMLOptions options = {});
// Pointer Lock
// https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
// https://github.com/w3c/pointerlock/pull/49
[MeasureAs=ElementRequestPointerLock, CallWith=ScriptState, RaisesException] Promise<undefined> requestPointerLock(optional PointerLockOptions options = {});
// CSSOM View Module
// https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface
[Measure] DOMRectList getClientRects();
[Affects=Nothing, Measure, RuntimeCallStatsCounter=ElementGetBoundingClientRect, ImplementedAs=GetBoundingClientRectForBinding] DOMRect getBoundingClientRect();
// https://drafts.csswg.org/cssom-view/#dom-element-checkvisibility
[MeasureAs=ElementCheckVisibility] boolean checkVisibility(optional CheckVisibilityOptions options = {});
void scrollIntoView(optional (ScrollIntoViewOptions or boolean) arg = {});
[ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options = {});
[ImplementedAs=scrollTo] void scroll(unrestricted double x, unrestricted double y);
void scrollTo(optional ScrollToOptions options = {});
void scrollTo(unrestricted double x, unrestricted double y);
void scrollBy(optional ScrollToOptions options = {});
void scrollBy(unrestricted double x, unrestricted double y);
attribute unrestricted double scrollTop;
attribute unrestricted double scrollLeft;
readonly attribute long scrollWidth;
readonly attribute long scrollHeight;
readonly attribute long clientTop;
readonly attribute long clientLeft;
readonly attribute long clientWidth;
readonly attribute long clientHeight;
[RuntimeEnabled=StandardizedBrowserZoom] readonly attribute double currentCSSZoom;
// Used by both Anchor Positioning and Popover
[CEReactions,RuntimeEnabled=HTMLAnchorAttribute,ImplementedAs=anchorElementForBinding] attribute Element? anchorElement;
// Non-standard API
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
// Experimental accessibility API
[RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedRole;
[RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedName;
// ARIA Notify API
// https://github.com/WICG/aom/blob/gh-pages/notification-api.md
[RuntimeEnabled=AriaNotify,MeasureAs=AriaNotify] void ariaNotify(DOMString announcement, optional AriaNotificationOptions options = {});
// Event handler attributes
attribute EventHandler onbeforecopy;
attribute EventHandler onbeforecut;
attribute EventHandler onbeforepaste;
attribute EventHandler onsearch;
// Element Timing
[CEReactions, Reflect=elementtiming] attribute DOMString elementTiming;
[RuntimeEnabled=ContainerTiming, CEReactions, Reflect=containertiming] attribute DOMString containerTiming;
// Heading Offset
[CEReactions, RuntimeEnabled=HeadingOffset] attribute unsigned long headingOffset;
[CEReactions, RuntimeEnabled=HeadingOffset] attribute boolean headingReset;
// Scoped Custom Element Registries
[RuntimeEnabled=ScopedCustomElementRegistry] readonly attribute CustomElementRegistry? customElementRegistry;
};
Element includes ParentNode;
Element includes ChildNode;
Element includes NonDocumentTypeChildNode;
|