API reference
Preparing search index…

Checked wrapper around an RmlUi-owned element.

Wrappers share native destruction detection. Operations throw after element destruction or runtime shutdown. Reinitialisation cannot revive old wrappers. Destruction automatically releases listeners. Moving a subtree between different render interfaces is rejected because native resources retain their original manager. Clone the subtree instead; contexts sharing an interface can transfer nodes with identity preserved.

Type hierarchy

Hierarchy (View Summary)

Source & inheritance
Member directory120

Constructors

Accessors

Methods

Constructors

  • Construct a detached native element, or wrap an internal native handle.

    Parameters

    tagOrHandle
    string | object

    Native tag, independent of the concrete native class.

    attributes
    Record<string, VariantValue> = {}

    Owned initial values; defaults to an empty dictionary.

    Returns

    Native allocators retain exact release provenance and initialize input defaults. No global Factory registration or plugin creation notification occurs. A JS subclass uses its nearest registered concrete native class. ElementFormControl is abstract and rejects direct tag construction.

    Source & inheritance

Accessors

  • get absoluteLeft(): number

    Read Rml::Element::GetAbsoluteLeft in context pixels.

    Returns

    number

    The horizontal context offset.

    Source & inheritance
  • get absoluteTop(): number

    Read Rml::Element::GetAbsoluteTop in context pixels.

    Returns

    number

    The vertical context offset.

    Source & inheritance
  • get baseline(): number

    Read GetBaseline: upward pixel offset from the bottom margin edge.

    Returns

    number

    The upward baseline offset in pixels.

    Source & inheritance
  • get clientHeight(): number

    Read GetClientHeight: padding height minus the horizontal scrollbar.

    Returns

    number

    The client height in pixels.

    Source & inheritance
  • get clientLeft(): number

    Read Rml::Element::GetClientLeft (left border width).

    Returns

    number

    The left border width.

    Source & inheritance
  • get clientTop(): number

    Read Rml::Element::GetClientTop (top border width).

    Returns

    number

    The top border width.

    Source & inheritance
  • get clientWidth(): number

    Read GetClientWidth: padding width minus the vertical scrollbar.

    Returns

    number

    The client width in pixels.

    Source & inheritance
  • get innerRML(): string

    Inner RML markup.

    Returns

    string

    Inner markup string.

    Source & inheritance
  • set innerRML(rml: string): void

    Replace child markup through Rml::Element::SetInnerRML.

    Parameters

    rml
    string

    New markup; existing child wrappers become invalid.

    Returns

    void
    Source & inheritance
  • get offsetHeight(): number

    Read GetOffsetHeight: content, padding and borders, excluding margins.

    Returns

    number

    The border height in pixels.

    Source & inheritance
  • get offsetLeft(): number

    Read GetOffsetLeft: border offset relative to the offset parent.

    Returns

    number

    The horizontal border offset.

    Source & inheritance
  • get offsetTop(): number

    Read GetOffsetTop: border offset relative to the offset parent.

    Returns

    number

    The vertical border offset.

    Source & inheritance
  • get offsetWidth(): number

    Read GetOffsetWidth: content, padding and borders, excluding margins.

    Returns

    number

    The border width in pixels.

    Source & inheritance
  • get scrollHeight(): number

    Read GetScrollHeight, including padding and scrollable content.

    Returns

    number

    The scrollable height in pixels.

    Source & inheritance
  • get scrollLeft(): number

    Native GetScrollLeft/SetScrollLeft with native rounding and clamping. Changing the offset synchronously dispatches a scroll event.

    Returns

    number

    The horizontal scroll offset.

    Source & inheritance
  • set scrollLeft(value: number): void

    Set the horizontal scroll offset through Rml::Element::SetScrollLeft.

    Parameters

    value
    number

    Horizontal offset in pixels, clamped by RmlUi.

    Returns

    void
    Source & inheritance
  • get scrollTop(): number

    Native GetScrollTop/SetScrollTop with native rounding and clamping. Changing the offset synchronously dispatches a scroll event.

    Returns

    number

    The vertical scroll offset.

    Source & inheritance
  • set scrollTop(value: number): void

    Set the vertical scroll offset through Rml::Element::SetScrollTop.

    Parameters

    value
    number

    Vertical offset in pixels, clamped by RmlUi.

    Returns

    void
    Source & inheritance
  • get scrollWidth(): number

    Read GetScrollWidth, including padding and scrollable content.

    Returns

    number

    The scrollable width in pixels.

    Source & inheritance

Methods

  • Append a copied key with Rml::Element::AddAnimationKey.

    Parameters

    property
    string | PropertyId

    Native property name or id.

    target

    Typed target value.

    duration
    number

    Additional nonnegative duration in seconds.

    tweenOptional

    Easing; defaults to native Linear/Out.

    Returns

    boolean

    Native success, including false when no animation exists.

    Source & inheritance
  • Attach an event listener.

    Parameters

    type
    string | number

    Event name or registered native EventId.

    listener

    Synchronous callback, shareable between registrations.

    capture
    boolean = false

    Listen in capture phase; defaults to false.

    Returns

    void

    Identical element/type/callback/capture registrations are idempotent. Removing the registration or destroying the element releases its callback. Listeners may remove themselves or other listeners during dispatch. Exceptions propagate from the native entry that dispatched the event. Classes, styles, target-local ordinary attributes, titles and unrelated subtrees may change synchronously. Removing active event targets or native call receivers is rejected, as are teardown and recursive update/input. Attribute set/removal also rejects ancestors of active targets. Setting or removing an active input's type is rejected to protect its widget. Schedule those operations after dispatch, for example with queueMicrotask.

    Source & inheritance
  • Start or replace Rml::Element::Animate for a property name or id.

    Parameters

    property
    string | PropertyId

    Native property name or id.

    target

    Typed target value, copied by RmlUi.

    duration
    number

    Nonnegative duration in seconds.

    tweenOptional

    Easing; defaults to native Linear/Out.

    iterations
    number = 1

    Iteration count; defaults to 1; -1 repeats forever.

    alternate
    boolean = true

    Reverse every second iteration; defaults to true.

    delay
    number = 0

    Delay in seconds; defaults to zero.

    start
    null | Property = null

    Copied start value; null uses the current property value.

    Returns

    boolean

    Native success; false for unknown or unsupported properties.

    Source & inheritance
  • Transfer a detached child through Rml::Element::AppendChild.

    Parameters

    child

    Owned detached node; remove an attached node first.

    domElement
    boolean = true

    Include in DOM traversal; defaults to true.

    Returns

    The same child wrapper.

    Rejects cycles, context roots and active native/event subtrees. Documents retain their context and can move only within that live context. A context root accepts only its own documents as DOM children. Ownership transfers once; listeners survive detaching and reinsertion. Native widget internals are readable but cannot be removed or replaced; non-DOM children inserted through these APIs remain transferable.

    Source & inheritance
  • Query Rml::Element::ArePseudoClassesSet for every name.

    Parameters

    names
    readonly string[]

    Names to check; an empty list returns true.

    Returns

    boolean

    Whether all names are active.

    Source & inheritance
  • Clone attributes, styles and content through Rml::Element::Clone.

    Returns

    null | Element

    Owned detached clone, or null on factory failure; no JS listeners.

    Source & inheritance
  • Find a matching ancestor through Rml::Element::Closest.

    Parameters

    selector
    string

    RCSS selector.

    Returns

    null | Element

    First matching ancestor, excluding this element, or null.

    Source & inheritance
  • Test ancestry through Rml::Element::Contains, including this element.

    Parameters

    element
    null | Element

    Candidate node, or null.

    Returns

    boolean

    True for self or descendants, false for null or unrelated nodes.

    Source & inheritance
  • Dispatch through Rml::Element::DispatchEvent, allowing nested dispatch.

    Parameters

    type
    string | number

    Event name or registered native EventId.

    parameters
    Readonly<Record<string, VariantValue>> = {}

    Typed native Variant values; defaults to empty.

    optionsOptional

    Omit to use the upstream event specification defaults.

    Returns

    boolean

    Whether the event remains propagating.

    Parameter getters run before native element validation. Destroying the receiver or a referenced element in a getter makes dispatch throw. Element parameters cannot be destroyed by subtree replacement in listeners.

    Source & inheritance
  • Request focus through Rml::Element::Focus.

    Parameters

    focusVisible
    boolean = false

    Activate focus-visible feedback; default false.

    Returns

    boolean

    Whether the native focus request succeeded.

    Source & inheritance
  • Copy Rml::Element::GetActivePseudoClasses.

    Returns

    string[]

    Independent snapshot in native order.

    Source & inheritance
  • Format Rml::Element::GetAddress, from this leaf toward its parents.

    Parameters

    includePseudoClasses
    boolean = false

    Include pseudo-classes; defaults to false.

    includeParents
    boolean = true

    Include ancestor addresses; defaults to true.

    Returns

    string

    Native address string, not a CSS selector.

    Source & inheritance
  • Read an attribute as a string.

    Parameters

    name
    string

    Attribute name.

    Returns

    null | string

    Attribute value or null when absent.

    Source & inheritance
  • Read Rml::Element::GetAttribute using the default's native type.

    Type Parameters

    Parameters

    name
    string

    Attribute name.

    defaultValue

    Non-null fallback, selecting native conversion.

    Returns

    Native converted value, initialized with the fallback.

    Numbers select double; BigInt selects int64, or uint64 above INT64_MAX. Unsafe number-to-integer conversions throw. Vectors and colours are copied. Missing keys retain the fallback; invalid numeric strings become zero for a number default, following native atof conversion.

    Source & inheritance
  • Copy the raw Rml::Variant returned by Rml::Element::GetAttribute.

    Parameters

    name
    string

    Attribute name.

    Returns

    Copied value; null for an absent attribute or native NONE.

    Source & inheritance
  • Copy the main Rml::Element::GetBox into independent native storage.

    Returns

    Writable box snapshot; apply changes with setBox.

    Source & inheritance
  • Copy Rml::Element::GetBox(index, offset), including its output offset.

    Parameters

    index
    number

    Box index; out of range returns the main box and zero offset. INT32_MIN is rejected to avoid upstream signed overflow.

    Returns

    Independently owned box and offset.

    Source & inheritance
  • Return Rml::Element::GetChild, including native non-DOM indices.

    Parameters

    index
    number

    Zero-based int32 index.

    Returns

    null | Element

    Child, or null outside the native child range.

    Source & inheritance
  • Read Rml::Element::GetClassNames as a space-separated string.

    Returns

    string

    Native class list.

    Source & inheritance
  • Read Rml::Element::GetClosestScrollableContainer, including this element.

    Returns

    null | Element

    Nearest native scroll container or null.

    Call context.update() to resolve styles and layout first. Auto/scroll overflow qualifies only when content exceeds the client size on that axis. Overscroll containment also qualifies, even without overflowing content.

    Source & inheritance
  • Read Rml::Element::GetContext through the owning document.

    Returns

    null | Context

    Canonical context; detached documents and their descendants retain it. Other detached elements and context roots return null.

    Source & inheritance
  • Read Rml::Element::GetDataModel through the checked native model index.

    Returns

    Canonical model constructor facade or null when unbound.

    Uses the model already attached by RmlUi; detachment or model removal clears the association. The returned model follows the context lifetime.

    Source & inheritance
  • Read GetAttribute<ScriptInterface*> with a checked element fallback.

    Parameters

    name
    string

    Attribute name.

    defaultValue
    null | Element = null

    Fallback for an absent key or failed conversion.

    Returns

    null | Element

    Live element; a destroyed stored target converts to null.

    Source & inheritance
  • Find an element by id in the owning document.

    Parameters

    id
    string

    Element id.

    Returns

    null | Element

    Matching element or null.

    Searches the whole owning document breadth first, including siblings. Without an owner, searches from this element. Special tokens are #self, #document and #parent. Use querySelector for descendant searches.

    Source & inheritance
  • Snapshot descendants through Rml::Element::GetElementsByClassName.

    Parameters

    name
    string

    Class name.

    Returns

    Snapshot array containing live wrappers.

    Source & inheritance
  • Snapshot descendants through Rml::Element::GetElementsByTagName.

    Parameters

    tag
    string

    Native tag name.

    Returns

    Snapshot array containing live wrappers.

    Source & inheritance
  • Copy Rml::Element::GetEventDispatcherSummary for debugging.

    Returns

    string

    Native event types and listener counts; empty when none exist.

    Source & inheritance
  • Get the deepest focused descendant, or this element if no child has focus.

    Returns

    Deepest focus descendant, or this element if no child has focus.

    Source & inheritance
  • Read native GetLineHeight from the computed values.

    Returns

    number

    The computed line height in pixels.

    Source & inheritance
  • Get the number of attribute keys on the element.

    Returns

    number

    Number of native attribute keys.

    Source & inheritance
  • Get the total number of main and additional layout boxes.

    Returns

    number

    Main box plus additional boxes.

    Source & inheritance
  • Count children through Rml::Element::GetNumChildren.

    Parameters

    includeNonDomElements
    boolean = false

    Include internal children; default false.

    Returns

    number

    Native child count.

    Source & inheritance
  • Copy Rml::Element::GetProperty into an owned property.

    Parameters

    name
    string | PropertyId

    Property name or native id.

    Returns

    null | Property

    Owned property or null when absent.

    Includes inheritance and defaults. Resolve cascading variables after a context update.

    Source & inheritance
  • Read Rml::Element::GetProperty using a native type exemplar.

    Type Parameters

    Parameters

    name
    string

    Property name.

    type

    Native conversion type exemplar.

    Returns

    Converted value or the native type's default value.

    Includes inheritance and defaults. Resolve cascading variables after a context update. Missing properties and failed conversions return T{}; the exemplar's value is not a fallback.

    Source & inheritance
  • Copy Rml::Element::GetRenderBox for mesh construction.

    Parameters

    fillArea
    BoxArea = BoxArea.Padding

    Border, Padding or Content; defaults to Padding.

    index
    number = 0

    Box index; defaults to zero. Same fallback as getBox(index).

    Returns

    Independent rendering-box value.

    Source & inheritance
  • Read Rml::Element::GetStyleSheet, including the document override.

    Returns

    null | StyleSheet

    Read-only compiled view, or null when no stylesheet is available.

    The view retains its container after document destruction or replacement. Any recompilation of that container invalidates earlier compiled views.

    Source & inheritance
  • Get a read-only view of the element’s computed transform state.

    Returns

    Read-only native view, or null if no state exists.

    Native transform state is updated during context.render().

    Source & inheritance
  • Query Rml::Element::HasAttribute, including attributes holding NONE.

    Parameters

    name
    string

    Attribute name.

    Returns

    boolean

    Whether the key exists.

    Source & inheritance
  • Check DOM children through Rml::Element::HasChildNodes.

    Returns

    boolean

    Whether at least one DOM child exists.

    Source & inheritance
  • Transfer a detached child through Rml::Element::InsertBefore.

    Parameters

    child

    Detached node, subject to appendChild ownership checks.

    adjacent
    null | Element

    Reference child; null or a non-child appends to the DOM.

    Returns

    Same child, inheriting the reference child's DOM/non-DOM status.

    Source & inheritance
  • Return whether a class is set.

    Parameters

    className
    string

    Class name.

    Returns

    boolean

    True when the class is present.

    Source & inheritance
  • Call native IsPointWithinElement against the element border. Project transformed screen points with project first.

    Parameters

    point

    Point in context pixels on the element plane.

    Returns

    boolean

    Whether the native border area contains the point.

    Source & inheritance
  • Query Rml::Element::IsPseudoClassSet.

    Parameters

    name
    string

    Pseudo-class name.

    Returns

    boolean

    Whether the pseudo-class is active.

    Source & inheritance
  • Call native IsReplaced for elements handling their own rendering.

    Returns

    boolean

    Whether this is a replaced element.

    Source & inheritance
  • Call native IsVisible, optionally checking ancestors.

    Parameters

    includeAncestors
    boolean = false

    Also test ancestors; defaults to false.

    Returns

    boolean

    The native visibility result.

    Source & inheritance
  • Snapshot Rml::Element::IterateLocalProperties in one native traversal.

    Parameters

    filterInheritedBy
    null | Element = null

    Keep only properties inherited by this element.

    Returns

    [string, Property][]

    Native-order name/property pairs with independent owned values.

    Includes inline and stylesheet/class properties, custom variables and variable shorthands. Native override and inheritance filtering apply. Copies remain readable after later style mutation or element destruction.

    Source & inheritance
  • Test this element through Rml::Element::Matches.

    Parameters

    selector
    string

    RCSS selector.

    Returns

    boolean

    Whether this element matches.

    Source & inheritance
  • Invoke virtual Rml::Element::ProcessDefaultAction with a live event.

    Parameters

    event

    Event from this element's currently executing listener.

    Returns

    void

    The receiver must equal event.currentTarget. Preserves phase, parameters and propagation state; even a stopped event runs its action. This does not cancel the later automatic action. Use stopPropagation on an interruptible event if it should run only manually. Sequential calls repeat native side effects; reentry with the same event during a manual action is rejected.

    Source & inheritance
  • Find the first matching descendant in native depth-first order.

    Parameters

    selector
    string

    CSS selector.

    Returns

    null | Element

    Matching element or null.

    Source & inheritance
  • Snapshot descendants through Rml::Element::QuerySelectorAll.

    Parameters

    selector
    string

    RCSS selector.

    Returns

    Stable array of live wrappers in native depth-first order.

    Source & inheritance
  • Release this detached owned native subtree through its original allocator.

    Returns

    void

    Attached, borrowed and active subtrees are rejected. Native destructors run synchronously and invalidate every surviving wrapper in the subtree.

    Source & inheritance
  • Remove an attribute.

    Parameters

    name
    string

    Attribute name.

    Returns

    void
    Source & inheritance
  • Take ownership through Rml::Element::RemoveChild.

    Parameters

    child

    Child to detach; active native/event subtrees reject.

    Returns

    null | Element

    Same detached wrapper, or null if it is not a child of this node.

    Source & inheritance
  • Detach a previously attached event listener.

    Parameters

    type
    string | number

    Event name or registered native EventId.

    listener

    Same callback reference used when attaching.

    capture
    boolean = false

    Same capture flag used when attaching; defaults to false.

    Returns

    void

    An unmatched registration is a no-op. All four fields must match.

    Source & inheritance
  • Remove a local CSS override (Rml::Element::RemoveProperty).

    Parameters

    name
    string | PropertyId

    Native id or name, including variables like --accent.

    Returns

    void
    Source & inheritance
  • Transfer ownership through Rml::Element::ReplaceChild.

    Parameters

    child

    Detached replacement, subject to appendChild checks.

    replaced
    null | Element

    Existing child; null or a non-child appends instead.

    Returns

    null | Element

    Detached replaced node with ownership, or null when appended.

    Source & inheritance
  • Rml::Element::ResolveLength in the element's current style and context.

    Parameters

    value

    Native numeric value; non-length units return zero.

    Returns

    number

    Length in pixels; invalid fields or overflow throw.

    Source & inheritance
  • Rml::Element::ResolveNumericValue with native unit conversion.

    Parameters

    value

    Numeric value. NUMBER multiplies the base; PERCENT scales it by number / 100; angles return radians; non-numeric units return zero.

    baseValue
    number

    Finite base for NUMBER and PERCENT.

    Returns

    number

    Resolved native value; invalid fields or overflow throw.

    Source & inheritance
  • Merge attributes through Rml::Element::SetAttributes.

    Parameters

    attributes
    Readonly<Record<string, VariantValue>>

    Owned values, fully converted before native mutation.

    Returns

    void

    Other keys remain. Native OnAttributeChange runs once for this group.

    Source & inheritance
  • Copy a value into Rml::Element::SetBox, clearing additional boxes.

    Parameters

    box

    Finite box value; later changes do not affect this element.

    Returns

    void

    Layout may replace manually assigned boxes on a subsequent update.

    Source & inheritance
  • Add or remove a class.

    Parameters

    className
    string

    Class name.

    activate
    boolean

    True adds, false removes.

    Returns

    void
    Source & inheritance
  • Replace all classes with Rml::Element::SetClassNames.

    Parameters

    names
    string

    Space-separated native class names.

    Returns

    void
    Source & inheritance
  • Set the native layout base through Rml::Element::SetOffset.

    Parameters

    offset

    Finite pixel coordinates; native position rules apply.

    offsetParent
    null | Element

    Strict ancestor or null for an independent base.

    offsetFixed
    boolean = false

    Ignore ancestor scrolling; defaults to false.

    Returns

    void

    Native layout may replace this base on the next update. Fixed positioning implies offsetFixed. Ancestor validation prevents cycles and dangling native layout pointers; detachment clears outgoing offset parents.

    Source & inheritance
  • Set a local RCSS property through Rml::Element::SetProperty.

    Parameters

    name
    string

    Property name for RCSS text, or PropertyId for a typed value.

    value
    string

    RCSS text or a native Property copied by value.

    Returns

    boolean

    Whether the property was applied.

    Source & inheritance
  • Set a local RCSS property through Rml::Element::SetProperty.

    Parameters

    name

    Property name for RCSS text, or PropertyId for a typed value.

    value

    RCSS text or a native Property copied by value.

    Returns

    boolean

    Whether the property was applied.

    Source & inheritance
  • Set a native pseudo-class through Rml::Element::SetPseudoClass.

    Parameters

    name
    string

    Pseudo-class name without a colon.

    active
    boolean

    Whether to activate it.

    Returns

    void
    Source & inheritance
  • Register a managed native script object, preserving DOM ownership.

    Parameters

    object
    null | object

    Host object, or null to clear the association.

    Returns

    void

    Attached native trees retain the object. Detached closure cycles remain collectible; clones start with null. Native RTTI stays unchanged.

    Source & inheritance
  • Call native SetScrollableOverflowRectangle.

    Parameters

    size

    Finite nonnegative dimensions in pixels.

    clampScrollOffset
    boolean

    Clamp after the final overflow size is known.

    Returns

    void
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0