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

Method append_before_sibling

css-inline/src/html/parser.rs:290–296  ·  view source on GitHub ↗

Append a node as the sibling immediately before the given node.

(&self, &sibling: &NodeId, child: NodeOrText<NodeId>)

Source from the content-addressed store, hash-verified

288
289 /// Append a node as the sibling immediately before the given node.
290 fn append_before_sibling(&self, &sibling: &NodeId, child: NodeOrText<NodeId>) {
291 self.append_impl(
292 child,
293 |document| document[sibling].previous_sibling,
294 |document, node| document.insert_before(sibling, node),
295 );
296 }
297
298 /// Add each attribute to the given element, if no attribute with that name already exists.
299 fn add_attrs_if_missing(&self, &target: &NodeId, attrs: Vec<Attribute>) {

Callers 1

Calls 2

append_implMethod · 0.80
insert_beforeMethod · 0.80

Tested by

no test coverage detected