Element.idl 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #import <DOM/DOMTokenList.idl>
  2. #import <DOM/NamedNodeMap.idl>
  3. #import <DOM/Node.idl>
  4. #import <DOM/NodeList.idl>
  5. #import <Geometry/DOMRect.idl>
  6. #import <Geometry/DOMRectList.idl>
  7. #import <CSS/CSSStyleDeclaration.idl>
  8. interface Element : Node {
  9. readonly attribute DOMString? namespaceURI;
  10. readonly attribute DOMString? prefix;
  11. readonly attribute DOMString localName;
  12. readonly attribute DOMString tagName;
  13. DOMString? getAttribute(DOMString qualifiedName);
  14. undefined setAttribute(DOMString qualifiedName, DOMString value);
  15. [CEReactions] undefined setAttributeNS(DOMString? namespace , DOMString qualifiedName , DOMString value);
  16. undefined removeAttribute(DOMString qualifiedName);
  17. boolean hasAttribute(DOMString qualifiedName);
  18. boolean hasAttributes();
  19. [SameObject] readonly attribute NamedNodeMap attributes;
  20. sequence<DOMString> getAttributeNames();
  21. HTMLCollection getElementsByTagName(DOMString tagName);
  22. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  23. HTMLCollection getElementsByClassName(DOMString className);
  24. // FIXME: This should come from a InnerHTML mixin.
  25. [LegacyNullToEmptyString, CEReactions] attribute DOMString innerHTML;
  26. [Reflect] attribute DOMString id;
  27. [Reflect=class] attribute DOMString className;
  28. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  29. boolean matches(DOMString selectors);
  30. Element? closest(DOMString selectors);
  31. // legacy alias of .matches
  32. [ImplementedAs=matches] boolean webkitMatchesSelector(DOMString selectors);
  33. readonly attribute Element? nextElementSibling;
  34. readonly attribute Element? previousElementSibling;
  35. [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style;
  36. // FIXME: These should all come from a ParentNode mixin (up to and including children)
  37. readonly attribute Element? firstElementChild;
  38. readonly attribute Element? lastElementChild;
  39. readonly attribute unsigned long childElementCount;
  40. [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
  41. [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
  42. [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
  43. Element? querySelector(DOMString selectors);
  44. [NewObject] NodeList querySelectorAll(DOMString selectors);
  45. [SameObject] readonly attribute HTMLCollection children;
  46. DOMRect getBoundingClientRect();
  47. DOMRectList getClientRects();
  48. readonly attribute long clientTop;
  49. readonly attribute long clientLeft;
  50. readonly attribute long clientWidth;
  51. readonly attribute long clientHeight;
  52. // FIXME: These should come from a ChildNode mixin
  53. [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
  54. [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
  55. [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
  56. [CEReactions, Unscopable, ImplementedAs=remove_binding] undefined remove();
  57. };