Kaynağa Gözat

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

This will allow us to give them special treatment, particularly when
they are an empty string.
Andreas Kling 2 yıl önce
ebeveyn
işleme
4ddfc3a6db

+ 1 - 0
Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp

@@ -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();