mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Ensure anonymous wrappers inherit inline-block display
When restructuring a block node inside an inline parent, if the nearest block ancestor is `display: inline-block`, ensure that the generated anonymous wrappers also have `display: inline-block`. This fixes layout issues with block elements nested inside inline-block elements.
This commit is contained in:
parent
09f5ce42f6
commit
6711438e0d
Notes:
github-actions[bot]
2025-05-23 09:17:05 +00:00
Author: https://github.com/abyesilyurt
Commit: 6711438e0d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4282
Reviewed-by: https://github.com/gmta ✅
4 changed files with 55 additions and 2 deletions
|
@ -1053,6 +1053,12 @@ GC::Ref<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const
|
|||
wrapper->mutable_computed_values().set_text_decoration_thickness(computed_values().text_decoration_thickness());
|
||||
wrapper->mutable_computed_values().set_text_decoration_color(computed_values().text_decoration_color());
|
||||
wrapper->mutable_computed_values().set_text_decoration_style(computed_values().text_decoration_style());
|
||||
|
||||
// CSS 2.2 9.2.1.1 creates anonymous block boxes, but 9.4.1 states inline-block creates a BFC.
|
||||
// Set wrapper to inline-block to participate correctly in the IFC within the parent inline-block.
|
||||
if (display().is_inline_block() && !has_children()) {
|
||||
wrapper->mutable_computed_values().set_display(CSS::Display::from_short(CSS::Display::Short::InlineBlock));
|
||||
}
|
||||
return *wrapper;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue