LibHTML: CSS parser should trim whitespace from values

This makes sure that values like "auto !important" don't have a space
character after "auto".
This commit is contained in:
Andreas Kling 2019-10-18 17:14:25 +02:00
parent e08991319a
commit 39546303da
Notes: sideshowbarker 2024-07-19 11:39:01 +09:00

View file

@ -292,6 +292,11 @@ public:
consume_whitespace_or_comments();
while (is_valid_property_value_char(peek()))
buffer.append(consume_one());
// Remove trailing whitespace.
while (!buffer.is_empty() && isspace(buffer.last()))
buffer.take_last();
auto property_value = String::copy(buffer);
buffer.clear();
consume_whitespace_or_comments();