PureHTML.TreeBuilder.SelectedContent (PureHTML v0.4.0)

View Source

The customizable select's selectedcontent mirroring, replayed after parsing.

This is not a rule of the tree construction algorithm. The forms chapter of the standard defines "update a select's selectedcontent": when an option becomes selected, the select's selectedcontent element has its contents replaced with a clone of the option's children. A browser runs it from the DOM insertion steps while the parser inserts nodes, so the resulting tree shows the cloned content; this module produces the same tree once the parse is complete.

See: https://html.spec.whatwg.org/multipage/form-elements.html#update-a-select's-selectedcontent

Summary

Functions

Replays "update a select's selectedcontent" over the finished tree: each select's selectedcontent element receives a clone of the children of its selected option, or of its first option.

Functions

populate(tree)

Replays "update a select's selectedcontent" over the finished tree: each select's selectedcontent element receives a clone of the children of its selected option, or of its first option.