1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Don't add shorthand CSS properties to cascaded values

We already expand shorthands in the cascade, so there's no need to
preserve them in the output.

This patch reorganizes the CSS::PropertyID enum values so that we can
easily iterate over all shorthand or longhand properties.
This commit is contained in:
Andreas Kling 2021-09-21 15:51:51 +02:00
parent e07cf6f41b
commit ca45d34055
2 changed files with 33 additions and 9 deletions

View file

@ -629,7 +629,7 @@ void StyleResolver::compute_defaulted_values(StyleProperties& style, DOM::Elemen
// Walk the list of all known CSS properties and:
// - Add them to `style` if they are missing.
// - Resolve `inherit` and `initial` as needed.
for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) {
for (auto i = to_underlying(CSS::first_longhand_property_id); i <= to_underlying(CSS::last_longhand_property_id); ++i) {
auto property_id = (CSS::PropertyID)i;
auto it = style.m_property_values.find(property_id);
if (it == style.m_property_values.end()) {