mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibHTML: Fix moving inline elements to unrelated block elements
LayoutBlock::inline_wrapper() is supposed to return an inline wrapper, a special anonymous block element intended to wrap inline children of a block element that also has block children. Add a check for whether the existing block child element is anonymous (refers to a DOM node), and if it's not create a new anonymous wrapper.
This commit is contained in:
parent
08c751d130
commit
756bdb2a42
Notes:
sideshowbarker
2024-07-19 11:56:52 +09:00
Author: https://github.com/bugaevc
Commit: 756bdb2a42
Pull-request: https://github.com/SerenityOS/serenity/pull/609
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ LayoutBlock::~LayoutBlock()
|
|||
|
||||
LayoutNode& LayoutBlock::inline_wrapper()
|
||||
{
|
||||
if (!last_child() || !last_child()->is_block()) {
|
||||
if (!last_child() || !last_child()->is_block() || last_child()->node() != nullptr) {
|
||||
append_child(adopt(*new LayoutBlock(nullptr, {})));
|
||||
}
|
||||
return *last_child();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue