vdom

package module
v0.0.0-...-4db39de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2021 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(node *html.Node) *html.Node

Types

type DOMNode

type DOMNode interface {
	// Replace the node with a new node, returning the new node.
	Replace(newNode DOMNode) DOMNode
	// Create a new Element node.
	CreateElement(name string) DOMNode
	// Create a new Text node.
	CreateText(text string) DOMNode

	// Return the first child of an Element node.
	// May panic if the node is not an Element node.
	FirstChild() DOMNode
	// Return the next sibling of a node.
	NextSibling() DOMNode
	// Add a child to the end of an Element node.
	// May panic if the node is not an Element node.
	AppendChild(child DOMNode)
	// Insert a child into an Element node at the given position.
	// May panic if the node is not an Element node.
	InsertBefore(newChild, oldChild DOMNode)
	// Remove the given child from an Element node.
	// May panic if the node is not an Element node.
	RemoveChild(child DOMNode)

	// Set an attribute on an Element node.
	// May panic if the node is not an Element node.
	SetAttr(attr, value string)
	// Remove an attribute from an Element node.
	// May panic if the node is not an Element node.
	DelAttr(attr string)
	// Set the text of a Text node
	// May panic if the node is not a Text node.
	SetText(text string)
}

func Construct

func Construct(node *html.Node, dom DOMNode) DOMNode

func Patch

func Patch(dom DOMNode, node, oldNode *html.Node) DOMNode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL