Element.idl 3.9 KB

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