mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWeb: Replace last couple of StyleValue casts with as_foo()
This commit is contained in:
parent
a83b620fa6
commit
058d44dcae
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/AtkinsSJ
Commit: 058d44dcae
Pull-request: https://github.com/SerenityOS/serenity/pull/10197
2 changed files with 3 additions and 3 deletions
|
@ -220,7 +220,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
|
|||
|
||||
auto bgimage = specified_style.property(CSS::PropertyID::BackgroundImage);
|
||||
if (bgimage.has_value() && bgimage.value()->is_image()) {
|
||||
m_background_image = static_ptr_cast<CSS::ImageStyleValue>(bgimage.value());
|
||||
m_background_image = bgimage.value()->as_image();
|
||||
}
|
||||
|
||||
// FIXME: BorderXRadius properties are now BorderRadiusStyleValues, so make use of that.
|
||||
|
@ -374,7 +374,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
|
|||
// FIXME: Converting to pixels isn't really correct - values should be in "user units"
|
||||
// https://svgwg.org/svg2-draft/coords.html#TermUserUnits
|
||||
if (stroke_width.value()->is_numeric())
|
||||
computed_values.set_stroke_width(CSS::Length::make_px(static_cast<CSS::NumericStyleValue const&>(*stroke_width.value()).value()));
|
||||
computed_values.set_stroke_width(CSS::Length::make_px(stroke_width.value()->to_number()));
|
||||
else
|
||||
computed_values.set_stroke_width(stroke_width.value()->to_length());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue