Element.idl 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
  16. dictionary ScrollIntoViewOptions : ScrollOptions {
  17. ScrollLogicalPosition block = "start";
  18. ScrollLogicalPosition inline = "nearest";
  19. };
  20. // https://dom.spec.whatwg.org/#element
  21. [Exposed=Window]
  22. interface Element : Node {
  23. readonly attribute DOMString? namespaceURI;
  24. readonly attribute DOMString? prefix;
  25. readonly attribute DOMString localName;
  26. readonly attribute DOMString tagName;
  27. DOMString? getAttribute(DOMString qualifiedName);
  28. undefined setAttribute(DOMString qualifiedName, DOMString value);
  29. [CEReactions] undefined setAttributeNS(DOMString? namespace , DOMString qualifiedName , DOMString value);
  30. [CEReactions] Attr? setAttributeNode(Attr attr);
  31. [CEReactions] Attr? setAttributeNodeNS(Attr attr);
  32. undefined removeAttribute(DOMString qualifiedName);
  33. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  34. boolean hasAttribute(DOMString qualifiedName);
  35. boolean hasAttributes();
  36. [SameObject] readonly attribute NamedNodeMap attributes;
  37. sequence<DOMString> getAttributeNames();
  38. Attr? getAttributeNode(DOMString qualifiedName);
  39. HTMLCollection getElementsByTagName(DOMString tagName);
  40. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  41. HTMLCollection getElementsByClassName(DOMString className);
  42. [Reflect] attribute DOMString id;
  43. [Reflect=class] attribute DOMString className;
  44. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  45. ShadowRoot attachShadow(ShadowRootInit init);
  46. readonly attribute ShadowRoot? shadowRoot;
  47. boolean matches(DOMString selectors);
  48. Element? closest(DOMString selectors);
  49. // legacy alias of .matches
  50. [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors);
  51. readonly attribute Element? nextElementSibling;
  52. readonly attribute Element? previousElementSibling;
  53. [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style;
  54. DOMRect getBoundingClientRect();
  55. DOMRectList getClientRects();
  56. attribute unrestricted double scrollTop;
  57. attribute unrestricted double scrollLeft;
  58. readonly attribute long scrollWidth;
  59. readonly attribute long scrollHeight;
  60. readonly attribute long clientTop;
  61. readonly attribute long clientLeft;
  62. readonly attribute long clientWidth;
  63. readonly attribute long clientHeight;
  64. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element);
  65. undefined insertAdjacentText(DOMString where, DOMString data);
  66. [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
  67. undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
  68. };
  69. dictionary ShadowRootInit {
  70. required ShadowRootMode mode;
  71. boolean delegatesFocus = false;
  72. // FIXME: SlotAssignmentMode slotAssignment = "named";
  73. };
  74. Element includes ParentNode;
  75. Element includes ChildNode;
  76. Element includes InnerHTML;
  77. // https://www.w3.org/TR/wai-aria-1.2/#idl_element
  78. Element includes ARIAMixin;