module

Opal::UI::QueryEngine

DOM Query Engine inspired by Python Textual's query() and query_one(). Allows locating widgets and elements within a tree using CSS-like selectors (#id, .class, WidgetType) or Crystal type classes.

Class methods

matches?(element : Element, token : String) : Bool

Tests if a single element satisfies a selector token

Source
query(root : Element, selector : String) : Array(Element)

Recursively finds all elements matching a CSS-like selector string

Source
query_type(root : Element, klass : T.class) : Array(T) forall T

Recursively finds all elements matching a specific Crystal type class

Source