From 0f7bcd4111bae9ae5e4e32c6c013511f89b255f6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 29 Mar 2020 22:24:23 +0200 Subject: [PATCH] LibWeb: Add naive support for document.querySelectorAll() This currently returns a JS::Array of elements matching a selector. The more correct behavior would be to return a static NodeList, but as we don't have NodeLists right now, that'll be a task for the future. --- Base/home/anon/www/qsa.html | 29 ++++ Base/home/anon/www/welcome.html | 1 + Libraries/LibWeb/Bindings/DocumentWrapper.cpp | 39 ++++- Libraries/LibWeb/Bindings/DocumentWrapper.h | 1 + Libraries/LibWeb/DOM/Document.cpp | 20 +++ Libraries/LibWeb/DOM/Document.h | 1 + Libraries/LibWeb/Dump.cpp | 141 +++++++++--------- Libraries/LibWeb/Dump.h | 8 +- Libraries/LibWeb/Forward.h | 6 +- Libraries/LibWeb/Parser/CSSParser.cpp | 13 ++ Libraries/LibWeb/Parser/CSSParser.h | 1 + 11 files changed, 182 insertions(+), 78 deletions(-) create mode 100644 Base/home/anon/www/qsa.html diff --git a/Base/home/anon/www/qsa.html b/Base/home/anon/www/qsa.html new file mode 100644 index 0000000000..a0df99c14a --- /dev/null +++ b/Base/home/anon/www/qsa.html @@ -0,0 +1,29 @@ + + + + + +
+
+
+

+
+
+
diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html
index af8dd8381d..01a80d67f7 100644
--- a/Base/home/anon/www/welcome.html
+++ b/Base/home/anon/www/welcome.html
@@ -23,6 +23,7 @@ h1 {
     

This is a very simple browser built on the LibWeb engine.

Some small test pages: