LibWeb: Mark content: "string" text nodes as generated

This will allow us to give them special treatment, particularly when
they are an empty string.
This commit is contained in:
Andreas Kling 2022-10-14 12:29:57 +02:00
parent 063d6cab8b
commit 4ddfc3a6db
Notes: sideshowbarker 2024-07-17 06:20:50 +09:00

View File

@ -167,6 +167,7 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Se
if (pseudo_element_content.type == CSS::ContentData::Type::String) {
auto* text = document.heap().allocate<DOM::Text>(document.realm(), document, pseudo_element_content.data);
auto text_node = adopt_ref(*new TextNode(document, *text));
text_node->set_generated(true);
push_parent(verify_cast<NodeWithStyle>(*pseudo_element_node));
insert_node_into_inline_or_block_ancestor(text_node, text_node->display(), AppendOrPrepend::Append);
pop_parent();