mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibWeb: Don't allow more than one color sub-value in CSS 'background'
This commit is contained in:
parent
3fefc7f3e9
commit
505b133fda
Notes:
sideshowbarker
2024-07-19 05:23:11 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/505b133fda5
1 changed files with 8 additions and 1 deletions
|
@ -353,8 +353,15 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
|||
for (auto& part : parts) {
|
||||
values.append(parse_css_value(part));
|
||||
}
|
||||
if (values[0].is_color())
|
||||
|
||||
// HACK: Disallow more than one color value in a 'background' shorthand
|
||||
size_t color_value_count = 0;
|
||||
for (auto& value : values)
|
||||
color_value_count += value.is_color();
|
||||
|
||||
if (values[0].is_color() && color_value_count == 1)
|
||||
style.set_property(CSS::PropertyID::BackgroundColor, values[0]);
|
||||
|
||||
for (auto& value : values) {
|
||||
if (!value.is_string())
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue