Serenity Operating System
at master 97 lines 3.5 kB view raw
1#import <ARIA/ARIAMixin.idl> 2#import <CSS/CSSStyleDeclaration.idl> 3#import <DOM/Attr.idl> 4#import <DOM/ChildNode.idl> 5#import <DOM/DOMTokenList.idl> 6#import <DOM/InnerHTML.idl> 7#import <DOM/NamedNodeMap.idl> 8#import <DOM/Node.idl> 9#import <DOM/NodeList.idl> 10#import <DOM/ParentNode.idl> 11#import <DOM/ShadowRoot.idl> 12#import <Geometry/DOMRect.idl> 13#import <Geometry/DOMRectList.idl> 14#import <HTML/Window.idl> 15 16enum ScrollLogicalPosition { "start", "center", "end", "nearest" }; 17dictionary ScrollIntoViewOptions : ScrollOptions { 18 ScrollLogicalPosition block = "start"; 19 ScrollLogicalPosition inline = "nearest"; 20}; 21 22// https://dom.spec.whatwg.org/#element 23[Exposed=Window] 24interface Element : Node { 25 readonly attribute DOMString? namespaceURI; 26 readonly attribute DOMString? prefix; 27 readonly attribute DOMString localName; 28 readonly attribute DOMString tagName; 29 30 DOMString? getAttribute(DOMString qualifiedName); 31 undefined setAttribute(DOMString qualifiedName, DOMString value); 32 [CEReactions] undefined setAttributeNS(DOMString? namespace , DOMString qualifiedName , DOMString value); 33 [CEReactions] Attr? setAttributeNode(Attr attr); 34 [CEReactions] Attr? setAttributeNodeNS(Attr attr); 35 36 undefined removeAttribute(DOMString qualifiedName); 37 [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force); 38 boolean hasAttribute(DOMString qualifiedName); 39 boolean hasAttributes(); 40 [SameObject] readonly attribute NamedNodeMap attributes; 41 sequence<DOMString> getAttributeNames(); 42 43 Attr? getAttributeNode(DOMString qualifiedName); 44 45 HTMLCollection getElementsByTagName(DOMString tagName); 46 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); 47 HTMLCollection getElementsByClassName(DOMString className); 48 49 [Reflect] attribute DOMString id; 50 [Reflect=class] attribute DOMString className; 51 [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; 52 53 ShadowRoot attachShadow(ShadowRootInit init); 54 readonly attribute ShadowRoot? shadowRoot; 55 56 boolean matches(DOMString selectors); 57 Element? closest(DOMString selectors); 58 59 // legacy alias of .matches 60 [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors); 61 62 readonly attribute Element? nextElementSibling; 63 readonly attribute Element? previousElementSibling; 64 65 [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style; 66 67 DOMRect getBoundingClientRect(); 68 DOMRectList getClientRects(); 69 70 attribute unrestricted double scrollTop; 71 attribute unrestricted double scrollLeft; 72 readonly attribute long scrollWidth; 73 readonly attribute long scrollHeight; 74 readonly attribute long clientTop; 75 readonly attribute long clientLeft; 76 readonly attribute long clientWidth; 77 readonly attribute long clientHeight; 78 79 [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); 80 undefined insertAdjacentText(DOMString where, DOMString data); 81 [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text); 82 83 undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); 84 85}; 86 87dictionary ShadowRootInit { 88 required ShadowRootMode mode; 89 boolean delegatesFocus = false; 90 // FIXME: SlotAssignmentMode slotAssignment = "named"; 91}; 92 93Element includes ParentNode; 94Element includes ChildNode; 95Element includes InnerHTML; 96// https://www.w3.org/TR/wai-aria-1.2/#idl_element 97Element includes ARIAMixin;