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

LibWeb: Implement CSS unset builtin value

This is equivalent to `initial` or `inherit`, depending on if the
property is inherited by default.
This commit is contained in:
Sam Atkins 2021-08-20 19:52:36 +01:00 committed by Andreas Kling
parent 3296fd70b3
commit b92a6d6542
3 changed files with 32 additions and 3 deletions

View file

@ -71,6 +71,13 @@ Optional<NonnullRefPtr<StyleValue>> StyleProperties::property(CSS::PropertyID id
return fetch_initial(id);
if (value->is_inherit())
return fetch_inherited(id);
if (value->is_unset()) {
if (is_inherited_property(id)) {
return fetch_inherited(id);
} else {
return fetch_initial(id);
}
}
return value;
}