Element.idl 3.4 KB

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