diff --git a/Tests/LibWeb/Layout/expected/select-with-option-selected.txt b/Tests/LibWeb/Layout/expected/select-with-option-selected.txt new file mode 100644 index 0000000000..0ed6b8356a --- /dev/null +++ b/Tests/LibWeb/Layout/expected/select-with-option-selected.txt @@ -0,0 +1,26 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x37 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x21 children: inline + frag 0 from BlockContainer start: 0, length: 0, rect: [13,10 89.109375x17] baseline: 16.5 + BlockContainer ) [8,8 99.109375x21] + PaintableBox (Box
) [13,10 89.109375x17] + PaintableWithLines (BlockContainer
) [13,10 69.109375x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
) [86.109375,10.5 16x16] + SVGSVGPaintable (SVGSVGBox) [86.109375,10.5 16x16] + SVGPathPaintable (SVGGeometryBox) [90.109375,16.21875 8x4.953125] diff --git a/Tests/LibWeb/Layout/input/select-with-option-selected.html b/Tests/LibWeb/Layout/input/select-with-option-selected.html new file mode 100644 index 0000000000..dd94c679d8 --- /dev/null +++ b/Tests/LibWeb/Layout/input/select-with-option-selected.html @@ -0,0 +1,5 @@ + + diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 605ad5cef2..8ab9966fa5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -323,9 +323,9 @@ void HTMLSelectElement::form_associated_element_was_inserted() auto options = list_of_options(); if (options.size() > 0) { options.at(0)->set_selected(true); - update_inner_text_element(); } } + update_inner_text_element(); }); }