diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-09-23 21:17:25 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-24 15:01:43 +0200 |
commit | 48ef5c8e846cda216efe561da457ea534f5bdf99 (patch) | |
tree | 8660736db932c75f760a7c3dbea2556ddcfad09b /Userland/Libraries/LibWeb/CSS | |
parent | 4b554ba92a3ddefdeae73444c69ca771e2df6c19 (diff) | |
download | serenity-48ef5c8e846cda216efe561da457ea534f5bdf99.zip |
LibWeb: Use new StyleValue API in ComputedCSSStyleDeclaration
Why manually cast things when a method can do it for you safely?
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/ComputedCSSStyleDeclaration.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ComputedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ComputedCSSStyleDeclaration.cpp index 33506df24f..fd708a6c4b 100644 --- a/Userland/Libraries/LibWeb/CSS/ComputedCSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/ComputedCSSStyleDeclaration.cpp @@ -484,20 +484,20 @@ RefPtr<StyleValue> ComputedCSSStyleDeclaration::style_value_for_property(Layout: auto maybe_bottom_right_radius = property(CSS::PropertyID::BorderBottomRightRadius); RefPtr<BorderRadiusStyleValue> top_left_radius, top_right_radius, bottom_left_radius, bottom_right_radius; if (maybe_top_left_radius.has_value()) { - VERIFY(maybe_top_left_radius.value().value->type() == StyleValue::Type::BorderRadius); - top_left_radius = *static_cast<BorderRadiusStyleValue*>(maybe_top_left_radius.value().value.ptr()); + VERIFY(maybe_top_left_radius.value().value->is_border_radius()); + top_left_radius = maybe_top_left_radius.value().value->as_border_radius(); } if (maybe_top_right_radius.has_value()) { - VERIFY(maybe_top_right_radius.value().value->type() == StyleValue::Type::BorderRadius); - top_right_radius = *static_cast<BorderRadiusStyleValue*>(maybe_top_right_radius.value().value.ptr()); + VERIFY(maybe_top_right_radius.value().value->is_border_radius()); + top_right_radius = maybe_top_right_radius.value().value->as_border_radius(); } if (maybe_bottom_left_radius.has_value()) { - VERIFY(maybe_bottom_left_radius.value().value->type() == StyleValue::Type::BorderRadius); - bottom_left_radius = *static_cast<BorderRadiusStyleValue*>(maybe_bottom_left_radius.value().value.ptr()); + VERIFY(maybe_bottom_left_radius.value().value->is_border_radius()); + bottom_left_radius = maybe_bottom_left_radius.value().value->as_border_radius(); } if (maybe_bottom_right_radius.has_value()) { - VERIFY(maybe_bottom_right_radius.value().value->type() == StyleValue::Type::BorderRadius); - bottom_right_radius = *static_cast<BorderRadiusStyleValue*>(maybe_bottom_right_radius.value().value.ptr()); + VERIFY(maybe_bottom_right_radius.value().value->is_border_radius()); + bottom_right_radius = maybe_bottom_right_radius.value().value->as_border_radius(); } return CombinedBorderRadiusStyleValue::create(top_left_radius.release_nonnull(), top_right_radius.release_nonnull(), bottom_right_radius.release_nonnull(), bottom_left_radius.release_nonnull()); |