From 8d6db36cbb8279effe2b3d83a93798e6de5685fc Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sat, 2 Oct 2021 20:33:45 +0100 Subject: LibWeb: Add support for NodeList This introduces 3 classes: NodeList, StaticNodeList and LiveNodeList. NodeList is the base of the static and live versions. Static is a snapshot whereas live acts on the underlying data and thus inhibits the same issues we have currently with HTMLCollection. They were split into separate classes to not have them weirdly mis-mashed together. The create functions for static and live both return a NNRP to the base class. This is to prevent having to do awkward casting at creation and/or return, as the bindings expect to see the base NodeList only. --- Userland/Libraries/LibWeb/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Userland/Libraries/LibWeb/CMakeLists.txt') diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index b2e36a510a..d4de8dfde7 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -66,12 +66,14 @@ set(SOURCES DOM/EventListener.cpp DOM/EventTarget.cpp DOM/HTMLCollection.cpp + DOM/LiveNodeList.cpp DOM/Node.cpp DOM/ParentNode.cpp DOM/Position.cpp DOM/ProcessingInstruction.cpp DOM/Range.cpp DOM/ShadowRoot.cpp + DOM/StaticNodeList.cpp DOM/Text.cpp DOM/Text.idl DOM/Timer.cpp @@ -371,6 +373,7 @@ libweb_js_wrapper(DOM/HTMLCollection) libweb_js_wrapper(DOM/ProcessingInstruction) libweb_js_wrapper(DOM/ShadowRoot) libweb_js_wrapper(DOM/Node) +libweb_js_wrapper(DOM/NodeList) libweb_js_wrapper(DOM/Range) libweb_js_wrapper(DOM/Text) libweb_js_wrapper(Geometry/DOMRect) -- cgit v1.2.3