1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:58:11 +00:00

LibWeb: Support more advanced selectors in document.querySelectorAll()

I made some mistakes in the selector parsing code. It's now able to
parse selectors composed of multiple complex selectors, instead of just
one complex selector.
This commit is contained in:
Andreas Kling 2020-03-29 22:45:38 +02:00
parent c1c56b1131
commit 06aec9667e
4 changed files with 21 additions and 17 deletions

View file

@ -315,6 +315,8 @@ NonnullRefPtrVector<Element> Document::query_selector_all(const StringView& sele
if (!selector.has_value())
return {};
dump_selector(selector.value());
NonnullRefPtrVector<Element> elements;
for_each_in_subtree_of_type<Element>([&](auto& element) {
if (SelectorEngine::matches(selector.value(), element)) {