LibWeb: Simplify property validity check in parse_anchor_size()
This commit is contained in:
parent
d9fac87e8a
commit
c1100a7c73
1 changed files with 4 additions and 10 deletions
|
|
@ -799,16 +799,10 @@ RefPtr<StyleValue const> Parser::parse_anchor_size(TokenStream<ComponentValue>&
|
|||
// FIXME: position-anchor
|
||||
// FIXME: position-area
|
||||
};
|
||||
bool valid_property_context = false;
|
||||
for (auto& value_context : m_value_context) {
|
||||
if (!value_context.has<PropertyID>())
|
||||
continue;
|
||||
if (!allowed_property_ids.contains_slow(value_context.get<PropertyID>())) {
|
||||
valid_property_context = false;
|
||||
break;
|
||||
}
|
||||
valid_property_context = true;
|
||||
}
|
||||
auto property_context = m_value_context.last_matching([](ValueParsingContext const& it) {
|
||||
return it.has<PropertyID>();
|
||||
});
|
||||
bool valid_property_context = property_context.has_value() && allowed_property_ids.contains_slow(property_context->get<PropertyID>());
|
||||
if (!valid_property_context)
|
||||
return {};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue