mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Make TreeBuilder treat inline-flex's children correctly
We were skipping over inline flex containers when looking for an insertion parent. This made us not generate flex items in those cases. This commit changes the behavior, so that non-inline-level items can get inserted into an inline-outside parent, as long as the parent isn't just flow-inside.
This commit is contained in:
parent
71f7bb619d
commit
b6ab9a261f
Notes:
sideshowbarker
2024-07-17 06:14:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b6ab9a261f
1 changed files with 3 additions and 1 deletions
|
@ -124,7 +124,9 @@ void TreeBuilder::insert_node_into_inline_or_block_ancestor(Layout::Node& node,
|
|||
// Non-inlines can't be inserted into an inline parent, so find the nearest non-inline ancestor.
|
||||
auto& nearest_non_inline_ancestor = [&]() -> Layout::NodeWithStyle& {
|
||||
for (auto& ancestor : m_ancestor_stack.in_reverse()) {
|
||||
if (!ancestor.is_inline() || ancestor.is_inline_block())
|
||||
if (!ancestor.display().is_inline_outside())
|
||||
return ancestor;
|
||||
if (!ancestor.display().is_flow_inside())
|
||||
return ancestor;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
Loading…
Reference in a new issue