Element.idl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. DOMString? getAttribute(DOMString qualifiedName);
  30. DOMString? getAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  31. [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
  32. [CEReactions] undefined setAttributeNS([FlyString] DOMString? namespace , [FlyString] DOMString qualifiedName , DOMString value);
  33. [CEReactions] Attr? setAttributeNode(Attr attr);
  34. [CEReactions] Attr? setAttributeNodeNS(Attr attr);
  35. [CEReactions] undefined removeAttribute([FlyString] DOMString qualifiedName);
  36. [CEReactions] undefined removeAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  37. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  38. boolean hasAttribute(DOMString qualifiedName);
  39. boolean hasAttributeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  40. boolean hasAttributes();
  41. [SameObject] readonly attribute NamedNodeMap attributes;
  42. sequence<DOMString> getAttributeNames();
  43. Attr? getAttributeNode([FlyString] DOMString qualifiedName);
  44. Attr? getAttributeNodeNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  45. HTMLCollection getElementsByTagName(DOMString tagName);
  46. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  47. HTMLCollection getElementsByClassName(DOMString className);
  48. [Reflect, CEReactions] attribute DOMString id;
  49. [Reflect=class, CEReactions] attribute DOMString className;
  50. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  51. [Reflect, CEReactions, Unscopable] attribute DOMString slot;
  52. ShadowRoot attachShadow(ShadowRootInit init);
  53. readonly attribute ShadowRoot? shadowRoot;
  54. boolean matches(DOMString selectors);
  55. Element? closest(DOMString selectors);
  56. // legacy alias of .matches
  57. [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors);
  58. readonly attribute Element? nextElementSibling;
  59. readonly attribute Element? previousElementSibling;
  60. DOMRect getBoundingClientRect();
  61. DOMRectList getClientRects();
  62. attribute unrestricted double scrollTop;
  63. attribute unrestricted double scrollLeft;
  64. readonly attribute long scrollWidth;
  65. readonly attribute long scrollHeight;
  66. readonly attribute long clientTop;
  67. readonly attribute long clientLeft;
  68. readonly attribute long clientWidth;
  69. readonly attribute long clientHeight;
  70. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element);
  71. undefined insertAdjacentText(DOMString where, DOMString data);
  72. [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
  73. undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
  74. undefined scroll(optional ScrollToOptions options = {});
  75. undefined scroll(unrestricted double x, unrestricted double y);
  76. [ImplementedAs=scroll] undefined scrollTo(optional ScrollToOptions options = {});
  77. [ImplementedAs=scroll] undefined scrollTo(unrestricted double x, unrestricted double y);
  78. };
  79. dictionary ShadowRootInit {
  80. required ShadowRootMode mode;
  81. boolean delegatesFocus = false;
  82. SlotAssignmentMode slotAssignment = "named";
  83. };
  84. Element includes ParentNode;
  85. Element includes ChildNode;
  86. Element includes InnerHTML;
  87. // https://www.w3.org/TR/wai-aria-1.2/#idl_element
  88. Element includes ARIAMixin;
  89. Element includes Slottable;
  90. // https://www.w3.org/TR/web-animations-1/#extensions-to-the-element-interface
  91. Element includes Animatable;