MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / append_based_on_parent_node

Method append_based_on_parent_node

css-inline/src/html/parser.rs:252–263  ·  view source on GitHub ↗
(
        &self,
        element: &NodeId,
        prev_element: &NodeId,
        child: NodeOrText<NodeId>,
    )

Source from the content-addressed store, hash-verified

250 }
251
252 fn append_based_on_parent_node(
253 &self,
254 element: &NodeId,
255 prev_element: &NodeId,
256 child: NodeOrText<NodeId>,
257 ) {
258 if self.document.borrow()[*element].parent.is_some() {
259 self.append_before_sibling(element, child);
260 } else {
261 self.append(prev_element, child);
262 }
263 }
264
265 /// Append a `DOCTYPE` element to the `Document` node.
266 fn append_doctype_to_document(

Callers

nothing calls this directly

Calls 2

append_before_siblingMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected