1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

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.
This commit is contained in:
Andreas Kling 2021-04-22 21:11:20 +02:00
parent 49f3d88baf
commit e4df1b223f
14 changed files with 207 additions and 55 deletions

View file

@ -3,6 +3,7 @@ set(SOURCES
Bindings/EventListenerWrapper.cpp
Bindings/EventWrapperFactory.cpp
Bindings/EventTargetWrapperFactory.cpp
Bindings/HTMLCollectionWrapperCustom.cpp
Bindings/ImageConstructor.cpp
Bindings/LocationObject.cpp
Bindings/MainThreadVM.cpp
@ -48,6 +49,7 @@ set(SOURCES
DOM/Element.cpp
DOM/ElementFactory.cpp
DOM/Event.cpp
DOM/HTMLCollection.cpp
DOM/Range.cpp
DOM/EventDispatcher.cpp
DOM/EventListener.cpp
@ -309,6 +311,7 @@ libweb_js_wrapper(DOM/DOMImplementation)
libweb_js_wrapper(DOM/Element)
libweb_js_wrapper(DOM/Event)
libweb_js_wrapper(DOM/EventTarget)
libweb_js_wrapper(DOM/HTMLCollection)
libweb_js_wrapper(DOM/ProcessingInstruction)
libweb_js_wrapper(DOM/ShadowRoot)
libweb_js_wrapper(DOM/Node)