@@ -234,7 +234,8 @@ std::string_view StyledNode::get_raw_property(css::PropertyId property) const {
auto it = std::ranges::find_if(
rbegin(properties), rend(properties), [=](auto const &p) { return p.first == property; });
if (it == rend(properties)) {
if (it == rend(properties) || it->second == "unset") {
// https://developer.mozilla.org/en-US/docs/Web/CSS/unset
if (is_inherited(property) && parent != nullptr) {
return parent->get_raw_property(property);
}
@@ -246,13 +247,6 @@ std::string_view StyledNode::get_raw_property(css::PropertyId property) const {
} else if (it->second == "inherit") {
// https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
return get_parent_raw_property(*this, property);
} else if (it->second == "unset") {
// https://developer.mozilla.org/en-US/docs/Web/CSS/unset
if (is_inherited(property) && parent != nullptr) {
return parent->get_raw_property(property);
}
return kInitialValues.at(property);
} else if (it->second == "currentcolor") {
// https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword
// If the "color" property has the value "currentcolor", treat it as "inherit".