diff --git a/Tests/LibWeb/Layout/expected/misc/set-display-null.txt b/Tests/LibWeb/Layout/expected/misc/set-display-null.txt new file mode 100644 index 0000000000..f4a0b262c1 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/misc/set-display-null.txt @@ -0,0 +1,9 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x116 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x100 children: not-inline + BlockContainer at (8,8) content-size 100x100 children: not-inline + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x116] + PaintableWithLines (BlockContainer) [8,8 784x100] + PaintableWithLines (BlockContainer
#box) [8,8 100x100] diff --git a/Tests/LibWeb/Layout/input/misc/set-display-null.html b/Tests/LibWeb/Layout/input/misc/set-display-null.html new file mode 100644 index 0000000000..8e099afc86 --- /dev/null +++ b/Tests/LibWeb/Layout/input/misc/set-display-null.html @@ -0,0 +1,9 @@ +
\ No newline at end of file diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index 792922821e..5ebbe1c368 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -432,7 +432,7 @@ JS::ThrowCompletionOr CSSStyleDeclaration::internal_set(JS::PropertyKey co if (property_id == CSS::PropertyID::Invalid) return Base::internal_set(name, value, receiver, cacheable_metadata); - auto css_text = TRY(value.to_string(vm)); + auto css_text = value.is_null() ? String {} : TRY(value.to_string(vm)); TRY(Bindings::throw_dom_exception_if_needed(vm, [&] { return set_property(property_id, css_text); })); return true;