Element.idl 4.3 KB

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