From 8946e509861f6c8be085770b8742c0dcfc5d6ff9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 21 Nov 2019 20:07:43 +0100 Subject: [PATCH] LibHTML: Implement some attribute selector support This patch adds a[foo] and a[foo=bar] attribute selectors. Note that an attribute selector is an optional part of a selector component, and not a component on its own. --- Base/home/anon/www/attrselectors.html | 19 ++++++++ Base/home/anon/www/welcome.html | 1 + Libraries/LibHTML/CSS/Selector.h | 10 ++++ Libraries/LibHTML/CSS/SelectorEngine.cpp | 13 +++++ Libraries/LibHTML/Dump.cpp | 20 +++++++- Libraries/LibHTML/Parser/CSSParser.cpp | 60 +++++++++++++++++++++--- 6 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 Base/home/anon/www/attrselectors.html diff --git a/Base/home/anon/www/attrselectors.html b/Base/home/anon/www/attrselectors.html new file mode 100644 index 0000000000..dd36f17093 --- /dev/null +++ b/Base/home/anon/www/attrselectors.html @@ -0,0 +1,19 @@ + + + CSS attribute selector test + + + +
This div has id="foo" and is bloo!
+
This div has a "cool" attribute and a cool green color.
+ + diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html index 9826b9a6e0..dd95f34c96 100644 --- a/Base/home/anon/www/welcome.html +++ b/Base/home/anon/www/welcome.html @@ -25,6 +25,7 @@ h1 {