ladybird/Userland/Libraries/LibWeb/DOM/Element.idl
Andreas Kling e4df1b223f LibWeb: Implement a slow but functional HTMLCollection :^)
HTMLCollection is an awkward legacy interface from the DOM spec.

It provides a live view of a DOM subtree, with some kind of filtering
that determines which elements are part of the collection.

We now return HTMLCollection objects from these APIs:

- getElementsByClassName()
- getElementsByName()
- getElementsByTagName()

This initial implementation does not do any kind of caching, since that
is quite a tricky problem, and there will be plenty of time for tricky
problems later on when the engine is more mature.
2021-04-22 21:21:46 +02:00

30 lines
1.2 KiB
Text

interface Element : Node {
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString tagName;
DOMString? getAttribute(DOMString qualifiedName);
undefined setAttribute(DOMString qualifiedName, DOMString value);
undefined removeAttribute(DOMString qualifiedName);
boolean hasAttribute(DOMString qualifiedName);
boolean hasAttributes();
HTMLCollection getElementsByTagName(DOMString tagName);
HTMLCollection getElementsByClassName(DOMString className);
[LegacyNullToEmptyString] attribute DOMString innerHTML;
[Reflect] attribute DOMString id;
[Reflect=class] attribute DOMString className;
readonly attribute Element? nextElementSibling;
readonly attribute Element? previousElementSibling;
[ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style;
// FIXME: These should all come from a ParentNode mixin
readonly attribute Element? firstElementChild;
readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;
Element? querySelector(DOMString selectors);
ArrayFromVector querySelectorAll(DOMString selectors);
};