diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 868d571417..3ce0aee612 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -961,7 +961,7 @@ Vector StyleProperties::text_shadow() const return shadow(PropertyID::TextShadow); } -CSS::BoxSizing StyleProperties::box_sizing() const +Optional StyleProperties::box_sizing() const { auto value = property(CSS::PropertyID::BoxSizing); if (!value.has_value()) diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.h b/Userland/Libraries/LibWeb/CSS/StyleProperties.h index a2676e142e..1a55552440 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.h +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.h @@ -74,7 +74,7 @@ public: Optional overflow_x() const; Optional overflow_y() const; Vector box_shadow() const; - CSS::BoxSizing box_sizing() const; + Optional box_sizing() const; Optional pointer_events() const; Variant vertical_align() const; Optional font_variant() const; diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 81ecad005b..3ce80add85 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -363,7 +363,8 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) } computed_values.set_background_color(computed_style.color_or_fallback(CSS::PropertyID::BackgroundColor, *this, CSS::InitialValues::background_color())); - computed_values.set_box_sizing(computed_style.box_sizing()); + if (auto box_sizing = computed_style.box_sizing(); box_sizing.has_value()) + computed_values.set_box_sizing(box_sizing.release_value()); if (auto maybe_font_variant = computed_style.font_variant(); maybe_font_variant.has_value()) computed_values.set_font_variant(maybe_font_variant.release_value());