mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 20:27:35 +00:00
LibWeb: Don't allow more than one color sub-value in CSS 'background'
This commit is contained in:
parent
3fefc7f3e9
commit
505b133fda
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) {
|
for (auto& part : parts) {
|
||||||
values.append(parse_css_value(part));
|
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]);
|
style.set_property(CSS::PropertyID::BackgroundColor, values[0]);
|
||||||
|
|
||||||
for (auto& value : values) {
|
for (auto& value : values) {
|
||||||
if (!value.is_string())
|
if (!value.is_string())
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue