summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-13 13:16:48 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-13 15:41:54 +0100
commit13c253d2ee35444d33300c4883746784a03ff124 (patch)
treeb8cdf50743485df5f7462ed93d06b177a2795cea /Userland
parent8fbe96af45723072699bd0345e170ae197043753 (diff)
downloadserenity-13c253d2ee35444d33300c4883746784a03ff124.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Selector.cpp2
1 files changed, 1 insertions, 1 deletions
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...