1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibWeb: Use text node's own display value when inserting CSS content

This ensures that the pseudo element wrapper is transformed into a block
container with inline children if needed.
This commit is contained in:
Andreas Kling 2022-10-06 21:00:16 +02:00
parent d3069bceeb
commit 71f7bb619d

View file

@ -166,7 +166,7 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Se
auto* text = document.heap().allocate<DOM::Text>(document.realm(), document, pseudo_element_content.data);
auto text_node = adopt_ref(*new TextNode(document, *text));
push_parent(verify_cast<NodeWithStyle>(*pseudo_element_node));
insert_node_into_inline_or_block_ancestor(text_node, pseudo_element_display, AppendOrPrepend::Append);
insert_node_into_inline_or_block_ancestor(text_node, text_node->display(), AppendOrPrepend::Append);
pop_parent();
} else {
TODO();