Element.idl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #import <Animations/Animatable.idl>
  2. #import <ARIA/ARIAMixin.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 <DOM/Slottable.idl>
  13. #import <Geometry/DOMRect.idl>
  14. #import <Geometry/DOMRectList.idl>
  15. #import <HTML/HTMLSlotElement.idl>
  16. #import <HTML/Window.idl>
  17. enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
  18. dictionary ScrollIntoViewOptions : ScrollOptions {
  19. ScrollLogicalPosition block = "start";
  20. ScrollLogicalPosition inline = "nearest";
  21. };
  22. // https://dom.spec.whatwg.org/#element
  23. [Exposed=Window]
  24. interface Element : Node {
  25. readonly attribute DOMString? namespaceURI;
  26. readonly attribute DOMString? prefix;
  27. readonly attribute DOMString localName;
  28. readonly attribute DOMString tagName;
  29. [Reflect, CEReactions] attribute DOMString id;
  30. [Reflect=class, CEReactions] attribute DOMString className;
  31. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  32. [Reflect, CEReactions, Unscopable] attribute DOMString slot;
  33. boolean hasAttributes();
  34. [SameObject] readonly attribute NamedNodeMap attributes;
  35. sequence<DOMString> getAttributeNames();
  36. DOMString? getAttribute(DOMString qualifiedName);
  37. DOMString? getAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  38. [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
  39. [CEReactions] undefined setAttributeNS([FlyString] DOMString? namespace , [FlyString] DOMString qualifiedName , DOMString value);
  40. [CEReactions] undefined removeAttribute([FlyString] DOMString qualifiedName);
  41. [CEReactions] undefined removeAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  42. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  43. boolean hasAttribute(DOMString qualifiedName);
  44. boolean hasAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  45. Attr? getAttributeNode([FlyString] DOMString qualifiedName);
  46. Attr? getAttributeNodeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  47. [CEReactions] Attr? setAttributeNode(Attr attr);
  48. [CEReactions] Attr? setAttributeNodeNS(Attr attr);
  49. [CEReactions] Attr removeAttributeNode(Attr attr);
  50. ShadowRoot attachShadow(ShadowRootInit init);
  51. readonly attribute ShadowRoot? shadowRoot;
  52. boolean matches(DOMString selectors);
  53. Element? closest(DOMString selectors);
  54. [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
  55. HTMLCollection getElementsByTagName(DOMString tagName);
  56. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  57. HTMLCollection getElementsByClassName(DOMString className);
  58. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy
  59. undefined insertAdjacentText(DOMString where, DOMString data); // legacy
  60. // https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
  61. readonly attribute Element? nextElementSibling;
  62. readonly attribute Element? previousElementSibling;
  63. // https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface
  64. DOMRectList getClientRects();
  65. DOMRect getBoundingClientRect();
  66. // FIXME: boolean checkVisibility(optional CheckVisibilityOptions options = {});
  67. undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
  68. undefined scroll(optional ScrollToOptions options = {});
  69. undefined scroll(unrestricted double x, unrestricted double y);
  70. [ImplementedAs=scroll] undefined scrollTo(optional ScrollToOptions options = {});
  71. [ImplementedAs=scroll] undefined scrollTo(unrestricted double x, unrestricted double y);
  72. undefined scrollBy(optional ScrollToOptions options = {});
  73. undefined scrollBy(unrestricted double x, unrestricted double y);
  74. attribute unrestricted double scrollTop;
  75. attribute unrestricted double scrollLeft;
  76. readonly attribute long scrollWidth;
  77. readonly attribute long scrollHeight;
  78. readonly attribute long clientTop;
  79. readonly attribute long clientLeft;
  80. readonly attribute long clientWidth;
  81. readonly attribute long clientHeight;
  82. readonly attribute double currentCSSZoom;
  83. // https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
  84. [CEReactions, LegacyNullToEmptyString] attribute DOMString outerHTML;
  85. [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
  86. };
  87. dictionary ShadowRootInit {
  88. required ShadowRootMode mode;
  89. boolean delegatesFocus = false;
  90. SlotAssignmentMode slotAssignment = "named";
  91. };
  92. Element includes ParentNode;
  93. Element includes ChildNode;
  94. Element includes InnerHTML;
  95. // https://www.w3.org/TR/wai-aria-1.2/#idl_element
  96. Element includes ARIAMixin;
  97. Element includes Slottable;
  98. // https://www.w3.org/TR/web-animations-1/#extensions-to-the-element-interface
  99. Element includes Animatable;