From 13c253d2ee35444d33300c4883746784a03ff124 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 13 Mar 2022 13:16:48 +0100 Subject: [PATCH] LibWeb: Fix serialization of selectors with universal subject (*) For seletors whose subject is unversal (i.e selectors that end in "*") we were not serializing the asterisk. Instead "foo bar *" came out as "foo bar foo". This patch fixes that by correctly serializing the last simple selector if it's universal. --- Userland/Libraries/LibWeb/CSS/Selector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index e088c8fefa..a81edfe313 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -205,7 +205,7 @@ String Selector::serialize() const // 1. If there is only one simple selector in the compound selectors which is a universal selector, append the result of serializing the universal selector to s. if (compound_selector.simple_selectors.size() == 1 && compound_selector.simple_selectors.first().type == Selector::SimpleSelector::Type::Universal) { - s.append(compound_selectors().first().simple_selectors.first().serialize()); + s.append(compound_selector.simple_selectors.first().serialize()); } // 2. Otherwise, for each simple selector in the compound selectors... // FIXME: ...that is not a universal selector of which the namespace prefix maps to a namespace that is not the default namespace...