Element.idl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #import <CSS/CSSStyleDeclaration.idl>
  2. #import <DOM/ChildNode.idl>
  3. #import <DOM/DOMTokenList.idl>
  4. #import <DOM/InnerHTML.idl>
  5. #import <DOM/NamedNodeMap.idl>
  6. #import <DOM/Node.idl>
  7. #import <DOM/NodeList.idl>
  8. #import <DOM/ParentNode.idl>
  9. #import <Geometry/DOMRect.idl>
  10. #import <Geometry/DOMRectList.idl>
  11. enum ScrollBehavior { "auto", "smooth" };
  12. dictionary ScrollOptions {
  13. ScrollBehavior behavior = "auto";
  14. };
  15. enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
  16. dictionary ScrollIntoViewOptions : ScrollOptions {
  17. ScrollLogicalPosition block = "start";
  18. ScrollLogicalPosition inline = "nearest";
  19. };
  20. // https://dom.spec.whatwg.org/#element
  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. undefined setAttribute(DOMString qualifiedName, DOMString value);
  28. [CEReactions] undefined setAttributeNS(DOMString? namespace , DOMString qualifiedName , DOMString value);
  29. undefined removeAttribute(DOMString qualifiedName);
  30. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  31. boolean hasAttribute(DOMString qualifiedName);
  32. boolean hasAttributes();
  33. [SameObject] readonly attribute NamedNodeMap attributes;
  34. sequence<DOMString> getAttributeNames();
  35. HTMLCollection getElementsByTagName(DOMString tagName);
  36. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  37. HTMLCollection getElementsByClassName(DOMString className);
  38. [Reflect] attribute DOMString id;
  39. [Reflect=class] attribute DOMString className;
  40. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  41. boolean matches(DOMString selectors);
  42. Element? closest(DOMString selectors);
  43. // legacy alias of .matches
  44. [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors);
  45. readonly attribute Element? nextElementSibling;
  46. readonly attribute Element? previousElementSibling;
  47. [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style;
  48. DOMRect getBoundingClientRect();
  49. DOMRectList getClientRects();
  50. readonly attribute long clientTop;
  51. readonly attribute long clientLeft;
  52. readonly attribute long clientWidth;
  53. readonly attribute long clientHeight;
  54. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element);
  55. undefined insertAdjacentText(DOMString where, DOMString data);
  56. [CEReactions] undefined insertAdjacentHTML(DOMString position, DOMString text);
  57. undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
  58. };
  59. Element includes ParentNode;
  60. Element includes ChildNode;
  61. Element includes InnerHTML;