mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
LibWeb: Don't crash on HTML input element with display: inline
This would previously assert in InlineFormattingContext because we had an outwardly inline box that wasn't inwardly flow. Fix this by converting text-based input boxes to inline-blocks. This is an ad-hoc solution, and there might be a much better way to solve it.
This commit is contained in:
parent
00999a245c
commit
a6d1307aa4
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/awesomekling
Commit: a6d1307aa4
3 changed files with 25 additions and 1 deletions
|
@ -71,7 +71,12 @@ JS::GCPtr<Layout::Node> HTMLInputElement::create_layout_node(NonnullRefPtr<CSS::
|
|||
if (type_state() == TypeAttributeState::RadioButton)
|
||||
return heap().allocate_without_realm<Layout::RadioButton>(document(), *this, move(style));
|
||||
|
||||
return heap().allocate_without_realm<Layout::BlockContainer>(document(), this, move(style));
|
||||
// AD-HOC: We rewrite `display: inline` to `display: inline-block`.
|
||||
// This is required for the internal shadow tree to work correctly in layout.
|
||||
if (style->display().is_inline_outside() && style->display().is_flow_inside())
|
||||
style->set_property(CSS::PropertyID::Display, CSS::IdentifierStyleValue::create(CSS::ValueID::InlineBlock));
|
||||
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
}
|
||||
|
||||
void HTMLInputElement::set_checked(bool checked, ChangeSource change_source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue