mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-13 09:50:36 +00:00
LibWeb: Remove "takes integer value" concept from parse_css_value()
This was only needed when numeric values had to be wrapped as Lengths, and now serves no purpose.
This commit is contained in:
parent
2a141600a3
commit
8e4a4fd4db
Notes:
sideshowbarker
2024-07-18 04:08:46 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/8e4a4fd4db5 Pull-request: https://github.com/SerenityOS/serenity/pull/9993
1 changed files with 1 additions and 15 deletions
|
@ -2872,22 +2872,8 @@ RefPtr<StyleValue> Parser::parse_css_value(PropertyID property_id, TokenStream<S
|
|||
return {};
|
||||
}
|
||||
|
||||
RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID property_id, StyleComponentValueRule const& component_value)
|
||||
RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID, StyleComponentValueRule const& component_value)
|
||||
{
|
||||
// FIXME: Figure out if we still need takes_integer_value, and if so, move this information
|
||||
// into Properties.json.
|
||||
auto takes_integer_value = [](PropertyID property_id) -> bool {
|
||||
return property_id == PropertyID::ZIndex
|
||||
|| property_id == PropertyID::FontWeight
|
||||
|| property_id == PropertyID::Custom;
|
||||
};
|
||||
if (takes_integer_value(property_id) && component_value.is(Token::Type::Number)) {
|
||||
auto number = component_value.token();
|
||||
if (number.m_number_type == Token::NumberType::Integer) {
|
||||
return LengthStyleValue::create(Length::make_px(number.to_integer()));
|
||||
}
|
||||
}
|
||||
|
||||
if (auto builtin = parse_builtin_value(context, component_value))
|
||||
return builtin;
|
||||
|
||||
|
|
Loading…
Reference in a new issue