From c1474e594ebb71085782f6c10b310335d9b1b61a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 16 Dec 2019 19:34:52 +0100 Subject: [PATCH] LibHTML: Support the :first-child and :last-child pseudo classes --- Base/home/anon/www/first-child.html | 24 ++++++++++++++++++++++++ Base/home/anon/www/last-child.html | 23 +++++++++++++++++++++++ Base/home/anon/www/welcome.html | 2 ++ Libraries/LibHTML/CSS/Selector.h | 2 ++ Libraries/LibHTML/CSS/SelectorEngine.cpp | 8 ++++++++ Libraries/LibHTML/Parser/CSSParser.cpp | 4 ++++ 6 files changed, 63 insertions(+) create mode 100644 Base/home/anon/www/first-child.html create mode 100644 Base/home/anon/www/last-child.html diff --git a/Base/home/anon/www/first-child.html b/Base/home/anon/www/first-child.html new file mode 100644 index 0000000000..553d814668 --- /dev/null +++ b/Base/home/anon/www/first-child.html @@ -0,0 +1,24 @@ + + +:first-child test + + + +
+

This text is selected!

+

This text isn't selected.

+
+ +
+

This text isn't selected: it's not a `p`.

+

This text isn't selected.

+
+ + + diff --git a/Base/home/anon/www/last-child.html b/Base/home/anon/www/last-child.html new file mode 100644 index 0000000000..562d85aac4 --- /dev/null +++ b/Base/home/anon/www/last-child.html @@ -0,0 +1,23 @@ + + +:last-child test + + + +
+

This text isn't selected.

+

This text is selected!

+
+ +
+

This text isn't selected.

+

This text isn't selected: it's not a `p`.

+
+ + diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html index d11541fc1c..1fbecdd0ca 100644 --- a/Base/home/anon/www/welcome.html +++ b/Base/home/anon/www/welcome.html @@ -24,6 +24,8 @@ h1 {

Some small test pages: