From 0eb9a9dd133fafd672d9217b4c9e06f88e653891 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 6 Apr 2021 12:23:32 +0200 Subject: [PATCH] LibWeb: Support the :first-of-type CSS selector :^) --- Base/res/html/misc/first-of-type.html | 13 +++++++++++++ Base/res/html/misc/welcome.html | 1 + .../LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 ++ Userland/Libraries/LibWeb/CSS/Selector.h | 1 + Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 6 ++++++ Userland/Libraries/LibWeb/Dump.cpp | 3 +++ 6 files changed, 26 insertions(+) create mode 100644 Base/res/html/misc/first-of-type.html diff --git a/Base/res/html/misc/first-of-type.html b/Base/res/html/misc/first-of-type.html new file mode 100644 index 0000000000..9749825aeb --- /dev/null +++ b/Base/res/html/misc/first-of-type.html @@ -0,0 +1,13 @@ + +
+
This `div is first!
+
This nested `span` is first!
+
This nested `em` is first, but this nested `em` is last!
+
This nested `span` gets styled!
+This `b` qualifies! +
This is the final `div`.
+
diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html index ee2d4c55c9..bf826530c4 100644 --- a/Base/res/html/misc/welcome.html +++ b/Base/res/html/misc/welcome.html @@ -38,6 +38,7 @@ span#loadtime {

This page loaded in ms

Some small test pages: