element

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StateChecked = 1 << iota
	StatePlaceholderShown
	StateIndeterminate
	StateDirtyChecked
	StateValueEmpty
	StateDirtyValue
	StateDirtySelected
)

Variables

This section is empty.

Functions

func DefaultSelectedIndex

func DefaultSelectedIndex(selectNode *uinode.Node) int

DefaultSelectedIndex returns the effective selection produced by resetting the select from its authored option attributes.

func FormOwner

func FormOwner(node *uinode.Node) *uinode.Node

FormOwner returns the form associated with a form control. An explicit form attribute takes precedence over the nearest ancestor form.

func HasDirtySelectedOption

func HasDirtySelectedOption(selectNode *uinode.Node) bool

func HasInputType

func HasInputType(node *uinode.Node, inputType string) bool

func InitializeDocument

func InitializeDocument(root *uinode.Node, visit func(*uinode.Node), keep func(*uinode.Node) bool)

InitializeDocument sets document order and form state. Visit observes each retained node in preorder. Keep can inspect and exclude a child before its subtree is initialized. Removed metadata can be consumed by Keep.

func InitializeElementStates

func InitializeElementStates(root *uinode.Node)

func IsChecked

func IsChecked(node *uinode.Node) bool

func IsContentEditable

func IsContentEditable(node *uinode.Node) bool

IsContentEditable resolves the enumerated contenteditable attribute through the element's ancestors.

func IsDisabled

func IsDisabled(node *uinode.Node) bool

func IsEditingHost

func IsEditingHost(node *uinode.Node) bool

IsEditingHost reports whether node starts a contenteditable region. Nested editable descendants are not independent sequential focus targets.

func IsPlaceholderShown

func IsPlaceholderShown(node *uinode.Node) bool

func IsWidgetControl added in v0.1.9

func IsWidgetControl(node *uinode.Node) bool

IsWidgetControl identifies elements rendered by the native HTML widget path.

func ResetForm

func ResetForm(form *uinode.Node) bool

ResetForm restores controls owned by form to their authored defaults. The traversal includes controls associated through an explicit form attribute.

func SameRadioGroup

func SameRadioGroup(left, right *uinode.Node) bool

func SelectedIndex

func SelectedIndex(selectNode *uinode.Node) int

SelectedIndex returns the first live selected option in tree order.

func SetLiveValue

func SetLiveValue(node *uinode.Node, value string, dirty bool)

SetLiveValue updates the compact value state used by :placeholder-shown. The string itself remains owned by the generated form control.

func SetOptionSelected

func SetOptionSelected(option *uinode.Node, selected bool) bool

SetOptionSelected updates one option's selectedness as the selected IDL property does. A single-select keeps at most one selected option.

func SetOptionSelectedAt

func SetOptionSelectedAt(selectNode *uinode.Node, optionIndex int, selected bool) bool

func SetSelectedIndex

func SetSelectedIndex(selectNode *uinode.Node, selected int)

SetSelectedIndex updates live option selectedness. The selected option gets a dirty flag; options deselected as a consequence retain their dirtyness.

func SetSelectedRange

func SetSelectedRange(selectNode *uinode.Node, start, end int) bool

SetSelectedRange applies a user range selection to a multiple select in one mutation pass. Disabled options retain their selectedness because keyboard and pointer input cannot toggle them.

func SupportsDisabled

func SupportsDisabled(node *uinode.Node) bool

func SupportsPlaceholder

func SupportsPlaceholder(node *uinode.Node) bool

func SynchronizeCheckedAttribute

func SynchronizeCheckedAttribute(node *uinode.Node, present bool)

SynchronizeCheckedAttribute applies a checked content-attribute mutation to live checkedness while the control's dirty checkedness flag is clear.

func SynchronizePlaceholderAttribute

func SynchronizePlaceholderAttribute(node *uinode.Node)

func SynchronizeSelectAttribute

func SynchronizeSelectAttribute(selectNode *uinode.Node, name string)

SynchronizeSelectAttribute applies multiple/size mutations to live selectedness using the select element's normalization rules.

func SynchronizeSelectChildren

func SynchronizeSelectChildren(node *uinode.Node)

SynchronizeSelectChildren normalizes live selection after an option list changes. Keep the last selected option without resetting defaults or dirtyness.

func SynchronizeSelectedAttribute

func SynchronizeSelectedAttribute(option *uinode.Node, present bool)

SynchronizeSelectedAttribute applies an option selected content-attribute mutation unless that option's live selectedness is dirty.

func SynchronizeTextContent

func SynchronizeTextContent(node *uinode.Node)

SynchronizeTextContent updates a textarea's live value state from its child text while the dirty value flag is clear.

func SynchronizeValueAttribute

func SynchronizeValueAttribute(node *uinode.Node)

SynchronizeValueAttribute updates live value state from an input value content attribute while the dirty value flag is clear.

func TabIndex

func TabIndex(node *uinode.Node) (int, bool)

TabIndex parses the global tabindex attribute as a valid signed integer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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