README

mizchi/crater-dom/dom does not have a README file

#
CoreError

pub enum CoreError {
NodeNotFound(node_id~ : NodeId)
InvalidOperation(message~ : String)
} derive(
Debug
)

Core error types
impl Show for CoreError

#
DomNode

type DomNode

Internal DOM node representation

#
DomTree

pub struct DomTree {
next_id : Int
nodes : Map[Int, DomNode]
root_id : Int
focused_node : Int?
mutations : MutationQueue
}

DOM Tree - the core document structure This is the single source of truth for all DOM operations

#
DomTree::append_child

fn DomTree::append_child(self : DomTree, parent : NodeId, child : NodeId) -> Result[Unit, CoreError]

Append child to parent

#
DomTree::assigned_slot

fn DomTree::assigned_slot(self : DomTree, node : NodeId) -> NodeId?

Node.assignedSlot. Returns the slot that node is assigned to, or None when node is not a slottable assigned to a slot in its parent host's shadow tree.

#
DomTree::attach_existing_shadow_root

fn DomTree::attach_existing_shadow_root(self : DomTree, host : NodeId, shadow_root : NodeId, mode : String) -> Result[Unit, CoreError]

Mark an existing document fragment as the host's shadow root

#
DomTree::attach_existing_shadow_root_with_init

fn DomTree::attach_existing_shadow_root_with_init(self : DomTree, host : NodeId, shadow_root : NodeId, init : ShadowRootInit) -> Result[Unit, CoreError]

#
DomTree::attach_shadow

fn DomTree::attach_shadow(self : DomTree, host : NodeId, mode : String) -> Result[NodeId, CoreError]

Attach a new shadow root to a host element

#
DomTree::attach_shadow_with_init

fn DomTree::attach_shadow_with_init(self : DomTree, host : NodeId, init : ShadowRootInit) -> Result[NodeId, CoreError]

#
DomTree::clear_mutations

fn DomTree::clear_mutations(self : DomTree) -> Unit

Clear all pending mutations without processing

#
DomTree::collect_shadow_matched_declarations

fn DomTree::collect_shadow_matched_declarations(self : DomTree, host : NodeId, rules : Array[
CSSRule
], target : NodeId) -> Array[
Declaration
]

Declarations from rules that apply to target when the rules are authored inside the shadow tree whose host is host, stamped with the matched selector's specificity and document source order so @css.cascade_declarations resolves the winner exactly like the document cascade (@cascade.cascade_rule_into). A rule whose selector fails to parse or does not match is skipped, so one malformed selector cannot abort styling.

#
DomTree::create_comment

fn DomTree::create_comment(self : DomTree, content : String) -> NodeId

Create a comment node

#
DomTree::create_document_fragment

fn DomTree::create_document_fragment(self : DomTree) -> NodeId

Create a document fragment node

#
DomTree::create_element

fn DomTree::create_element(self : DomTree, tag_name : String) -> NodeId

Create an element node

#
DomTree::create_runtime_node

fn DomTree::create_runtime_node(self : DomTree, id : Int, node_type : NodeType, tag_name? : String, text_content? : String) -> Result[NodeId, CoreError]

#
DomTree::create_text

fn DomTree::create_text(self : DomTree, content : String) -> NodeId

Create a text node

#
DomTree::flush_mutations

fn DomTree::flush_mutations(self : DomTree) -> (Array[MutationRecord], FlushResult)

Flush pending mutations and return optimized records Returns (records, result) where records is the optimized mutation list and result contains statistics about the flush operation

#
DomTree::flush_mutations_with

fn[T] DomTree::flush_mutations_with(self : DomTree, handler : (MutationRecord) -> T) -> (Array[T], FlushResult)

Flush mutations with a custom handler for each record Useful for applying mutations to other systems (e.g., LayoutTree)

#
DomTree::get_attribute

fn DomTree::get_attribute(self : DomTree, node : NodeId, name : String) -> Result[String?, CoreError]

Get attribute from element

#
DomTree::get_attributes

fn DomTree::get_attributes(self : DomTree, node : NodeId) -> Result[Array[(String, String)], CoreError]

Get all attributes

#
DomTree::get_bbox

fn DomTree::get_bbox(self : DomTree, node_id : NodeId, options? : GetBBoxOptions) -> SVGRect?

Get the bounding box of an SVG element Returns the tight bounding box in user space coordinates

#
DomTree::get_cached_rect

fn DomTree::get_cached_rect(self : DomTree, node : NodeId) -> Rect?

Get cached rect

#
DomTree::get_children

fn DomTree::get_children(self : DomTree, node : NodeId) -> Result[Array[NodeId], CoreError]

Get child nodes

#
DomTree::get_composed_children

fn DomTree::get_composed_children(self : DomTree, node : NodeId, shadow_host? : NodeId?) -> Array[NodeId]

Return the composed children for a node in the current tree scope.

  • Shadow hosts expose their shadow root children instead of light DOM children.
  • Slot elements inside a shadow tree expose assigned light DOM nodes, falling back to their own children when no assignment exists.

#
DomTree::get_ctm

fn DomTree::get_ctm(self : DomTree, node_id : NodeId) -> SVGMatrix?

Get the Current Transformation Matrix (CTM) Returns the transformation from user space to viewport

#
DomTree::get_custom_states

fn DomTree::get_custom_states(self : DomTree, node : NodeId) -> Result[Array[String], CoreError]

#
DomTree::get_document

fn DomTree::get_document(self : DomTree) -> NodeId

Get document root

#
DomTree::get_first_child

fn DomTree::get_first_child(self : DomTree, node : NodeId) -> Result[NodeId?, CoreError]

Get first child

#
DomTree::get_focus

fn DomTree::get_focus(self : DomTree) -> NodeId?

Get focused element

#
DomTree::get_form_associated_state

fn DomTree::get_form_associated_state(self : DomTree, node : NodeId) -> Result[(String?, String?), CoreError]

#
DomTree::get_host

fn DomTree::get_host(self : DomTree, node : NodeId) -> Result[NodeId?, CoreError]

Get host for a shadow root

#
DomTree::get_mutation_queue

fn DomTree::get_mutation_queue(self : DomTree) -> MutationQueue

Get direct access to the mutation queue (for advanced use cases)

#
DomTree::get_next_sibling

fn DomTree::get_next_sibling(self : DomTree, node : NodeId) -> Result[NodeId?, CoreError]

Get next sibling

#
DomTree::get_node_info

fn DomTree::get_node_info(self : DomTree, node : NodeId) -> Result[NodeInfo, CoreError]

Get node info

#
DomTree::get_parent

fn DomTree::get_parent(self : DomTree, node : NodeId) -> Result[NodeId?, CoreError]

Get parent node

#
DomTree::get_root_node

fn DomTree::get_root_node(self : DomTree, node : NodeId, composed? : Bool) -> Result[NodeId, CoreError]

Get root node for a node

#
DomTree::get_screen_ctm

fn DomTree::get_screen_ctm(self : DomTree, node_id : NodeId) -> SVGMatrix?

Get the Screen CTM Returns the transformation from user space to screen pixels

#
DomTree::get_shadow_init

fn DomTree::get_shadow_init(self : DomTree, node : NodeId) -> Result[ShadowRootInit?, CoreError]

#
DomTree::get_shadow_mode

fn DomTree::get_shadow_mode(self : DomTree, node : NodeId) -> Result[String?, CoreError]

Get shadow mode for a shadow root

#
DomTree::get_shadow_root

fn DomTree::get_shadow_root(self : DomTree, host : NodeId) -> Result[NodeId?, CoreError]

Get shadow root for a host element

#
DomTree::get_tag_name

fn DomTree::get_tag_name(self : DomTree, node : NodeId) -> Result[String, CoreError]

Get tag name

#
DomTree::get_text_content

fn DomTree::get_text_content(self : DomTree, node : NodeId) -> Result[String, CoreError]

Get text content

#
DomTree::has_pending_mutations

fn DomTree::has_pending_mutations(self : DomTree) -> Bool

Check if there are pending mutations

#
DomTree::has_shadow_roots

fn DomTree::has_shadow_roots(self : DomTree) -> Bool

#
DomTree::insert_before

fn DomTree::insert_before(self : DomTree, parent : NodeId, child : NodeId, reference : NodeId?) -> Result[Unit, CoreError]

Insert child before reference node

#
DomTree::is_slot_element

fn DomTree::is_slot_element(self : DomTree, node : NodeId) -> Bool

Whether a node is a slot element

#
DomTree::matches_shadow_scoped

fn DomTree::matches_shadow_scoped(self : DomTree, subject : NodeId, selector : String, host : NodeId) -> Result[Bool, CoreError]

Match subject against selector as authored inside the shadow tree whose host is host. Returns whether the subject is selected. An unparseable selector yields InvalidOperation.

#
DomTree::new

fn DomTree::new() -> DomTree

Create a new empty DOM tree

#
DomTree::node_to_selector_element

fn DomTree::node_to_selector_element(self : DomTree, id : NodeId) ->
Element
?

Project an element node into a standalone @selector.Element (carrying its own tag / id / classes / attributes and element-sibling index/count, with no ancestor chain). None for non-element nodes. This is the same type the renderer's cascade consumes (@css.Element re-exports @selector.Element), so a shadow-tree node can be styled through the renderer pipeline.

#
DomTree::pending_mutation_count

fn DomTree::pending_mutation_count(self : DomTree) -> Int

Get number of pending mutations

#
DomTree::query_selector

fn DomTree::query_selector(self : DomTree, root : NodeId, selector : String) -> Result[NodeId?, CoreError]

Query selector — returns the first matching node in document order.

#
DomTree::query_selector_all

fn DomTree::query_selector_all(self : DomTree, root : NodeId, selector : String) -> Result[Array[NodeId], CoreError]

Query selector all — returns every matching node in document order.

#
DomTree::remove_attribute

fn DomTree::remove_attribute(self : DomTree, node : NodeId, name : String) -> Result[Unit, CoreError]

Remove attribute from element

#
DomTree::remove_child

fn DomTree::remove_child(self : DomTree, parent : NodeId, child : NodeId) -> Result[Unit, CoreError]

Remove child from parent

#
DomTree::set_attribute

fn DomTree::set_attribute(self : DomTree, node : NodeId, name : String, value : String) -> Result[Unit, CoreError]

Set attribute on element

#
DomTree::set_cached_rect

fn DomTree::set_cached_rect(self : DomTree, node : NodeId, rect : Rect) -> Unit

Set cached rect (called by layout engine)

#
DomTree::set_custom_states

fn DomTree::set_custom_states(self : DomTree, node : NodeId, states : Array[String]) -> Result[Unit, CoreError]

#
DomTree::set_focus

fn DomTree::set_focus(self : DomTree, node : NodeId?) -> Unit

Set focused element

#
DomTree::set_form_associated_state

fn DomTree::set_form_associated_state(self : DomTree, node : NodeId, form_value : String?, form_state_value : String?) -> Result[Unit, CoreError]

#
DomTree::set_mutation_recording

fn DomTree::set_mutation_recording(self : DomTree, on : Bool) -> Unit

Enable or disable mutation recording. Off by default: records exist only to feed the incremental-layout bridge, so a standalone tree (querySelector / one-shot build) records nothing. The bridge enables it on the trees it owns.

#
DomTree::set_text_content

fn DomTree::set_text_content(self : DomTree, node : NodeId, content : String) -> Result[Unit, CoreError]

Set text content

#
DomTree::shadow_cascaded_values

Cascade the shadow rules that apply to target (host is host) into the winning @cascade.CascadedValues, resolving specificity / source order via the shared @css.cascade_declarations.

#
DomTree::shadow_query_selector

fn DomTree::shadow_query_selector(self : DomTree, shadow_root : NodeId, selector : String) -> Result[NodeId?, CoreError]

Shadow-scoped querySelector: the first shadow-tree element selected by selector in document order, or None.

#
DomTree::shadow_query_selector_all

fn DomTree::shadow_query_selector_all(self : DomTree, shadow_root : NodeId, selector : String) -> Result[Array[NodeId], CoreError]

Shadow-scoped querySelectorAll: every shadow-tree element selected by selector, in document order. shadow_root must be a shadow root node; its host (resolved from the shadow root) anchors :host / :host-context / ::slotted resolution. An invalid selector yields InvalidOperation.

#
DomTree::shadow_stylesheet_rules

fn DomTree::shadow_stylesheet_rules(self : DomTree, shadow_root : NodeId) -> Array[
CSSRule
]

Parse every <style> element in the shadow tree rooted at shadow_root into a flat list of rules, in document order. Nested elements are descended, but nested shadow roots are not (their styles belong to their own tree).

#
DomTree::slot_assigned_elements

fn DomTree::slot_assigned_elements(self : DomTree, slot : NodeId, flatten? : Bool) -> Array[NodeId]

HTMLSlotElement.assignedElements(). Like slot_assigned_nodes but filtered to element nodes.

#
DomTree::slot_assigned_nodes

fn DomTree::slot_assigned_nodes(self : DomTree, slot : NodeId, flatten? : Bool) -> Array[NodeId]

HTMLSlotElement.assignedNodes(). Returns the slottable nodes (elements and text) assigned to slot, in tree order.

With flatten, an empty assignment falls back to the slot's own children (its default content), and any assigned slot is recursively replaced by its own flattened assigned nodes — matching assignedNodes({ flatten: true }).

#
FlushResult

pub struct FlushResult {
processed : Int
nodes_affected : Int
needs_layout : Bool
} derive(
Debug
)

Result of flushing the mutation queue
impl Show for FlushResult

#
GetBBoxOptions

pub struct GetBBoxOptions {
fill : Bool
stroke : Bool
markers : Bool
clipped : Bool
} derive(Eq,
Debug
)

Options for getBBox() method Corresponds to SVGBoundingBoxOptions in the spec

#
GetBBoxOptions::all

Create getBBox options with all geometry

#
GetBBoxOptions::default

Default getBBox options (fill only)

#
MutationQueue

pub struct MutationQueue {
records : Array[MutationRecord]
dirty_nodes : Map[Int, Bool]
is_flushing : Bool
deferred : Array[MutationRecord]
recording : Bool
}

Queue for batching mutations

#
MutationQueue::clear

fn MutationQueue::clear(self : MutationQueue) -> Unit

Clear all pending mutations without processing

#
MutationQueue::flush

Flush the queue and return optimized records for processing The caller is responsible for applying these to the layout tree

#
MutationQueue::flush_with

fn[T] MutationQueue::flush_with(self : MutationQueue, handler : (MutationRecord) -> T) -> (Array[T], FlushResult)

Process mutations with a callback for each record Returns the flush result

#
MutationQueue::has_pending

fn MutationQueue::has_pending(self : MutationQueue, node : NodeId) -> Bool

Check if a node has pending mutations

#
MutationQueue::is_empty

fn MutationQueue::is_empty(self : MutationQueue) -> Bool

Check if queue is empty

#
MutationQueue::length

fn MutationQueue::length(self : MutationQueue) -> Int

Get number of pending mutations

#
MutationQueue::new

Create a new empty mutation queue

#
MutationQueue::optimize

Optimize the queue by merging related mutations

#
MutationQueue::push

fn MutationQueue::push(self : MutationQueue, record : MutationRecord) -> Unit

Add a mutation record to the queue

#
MutationQueue::record_attribute

fn MutationQueue::record_attribute(self : MutationQueue, target : NodeId, name : String, old_value? : String?, new_value? : String?) -> Unit

Build and queue an attribute-change record only when recording.

#
MutationQueue::record_character_data

fn MutationQueue::record_character_data(self : MutationQueue, target : NodeId, old_value? : String?, new_value? : String?) -> Unit

Build and queue a character-data record only when recording.

#
MutationQueue::record_child_added

fn MutationQueue::record_child_added(self : MutationQueue, target : NodeId, child : NodeId) -> Unit

Build and queue a child-list "added" record only when recording, so the record and its single-element array allocate nothing on standalone trees.

#
MutationQueue::record_child_removed

fn MutationQueue::record_child_removed(self : MutationQueue, target : NodeId, child : NodeId) -> Unit

Build and queue a child-list "removed" record only when recording.

#
MutationQueue::set_recording

fn MutationQueue::set_recording(self : MutationQueue, on : Bool) -> Unit

Enable or disable mutation recording. When disabled (the default), push is a no-op, so building a tree with no mutation consumer allocates no records.

#
MutationRecord

pub struct MutationRecord {
type_ : MutationType
target : NodeId
added_nodes : Array[NodeId]
removed_nodes : Array[NodeId]
attribute_name : String?
old_value : String?
new_value : String?
changed_properties : Array[String]
} derive(
Debug
)

Record of a single DOM mutation

#
MutationRecord::affects_layout

fn MutationRecord::affects_layout(self : MutationRecord) -> Bool

Check if this mutation affects layout (vs paint-only)

#
MutationRecord::attribute

fn MutationRecord::attribute(target : NodeId, name : String, old_value? : String?, new_value? : String?) -> MutationRecord

Create an Attributes mutation record

#
MutationRecord::character_data

fn MutationRecord::character_data(target : NodeId, old_value? : String?, new_value? : String?) -> MutationRecord

Create a CharacterData mutation record

#
MutationRecord::child_list

fn MutationRecord::child_list(target : NodeId, added? : Array[NodeId], removed? : Array[NodeId]) -> MutationRecord

Create a ChildList mutation record

#
MutationRecord::style_change

fn MutationRecord::style_change(target : NodeId, properties : Array[String]) -> MutationRecord

Create a StyleChange mutation record

#
MutationType

pub enum MutationType {
ChildList
Attributes
CharacterData
StyleChange
} derive(Eq,
Debug
)

Type of DOM mutation

#
NodeId

pub struct NodeId(Int) derive(Eq, Hash,
Debug
)

Node identifier - opaque handle to a DOM node
impl Show for NodeId

#
NodeId::from_int

fn NodeId::from_int(id : Int) -> NodeId

Create NodeId from Int

#
NodeId::to_int

fn NodeId::to_int(self : NodeId) -> Int

Get Int value from NodeId

#
NodeInfo

pub struct NodeInfo {
node_id : NodeId
node_type : NodeType
node_name : String
node_value : String
child_count : Int
} derive(
Debug
)

Basic node information
impl Show for NodeInfo

#
NodeType

pub(all) enum NodeType {
Document
DocumentType
Element
Text
Comment
DocumentFragment
ShadowRoot
} derive(Eq,
Debug
)

Node type enumeration
impl Show for NodeType

#
NodeType::from_dom_constant

fn NodeType::from_dom_constant(value : Int) -> NodeType?

Convert DOM node type constant to NodeType See: https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType

#
Point

pub struct Point {
x : Double
y : Double
} derive(Eq,
Debug
)

2D Point
impl Show for Point

#
Rect

pub struct Rect {
x : Double
y : Double
width : Double
height : Double
} derive(Eq,
Debug
)

Rectangle with position and size
impl Show for Rect

#
Rect::center

fn Rect::center(self : Rect) -> Point

Convert Rect to center point

#
Rect::new

fn Rect::new(x : Double, y : Double, width : Double, height : Double) -> Rect

Create a new Rect

#
SVGAngle

pub struct SVGAngle {
unit_type : SVGAngleType
value : Double
value_in_specified_units : Double
} derive(Eq,
Debug
)

SVGAngle - represents an angle value with unit
impl Show for SVGAngle

#
SVGAngle::new

fn SVGAngle::new(value : Double) -> SVGAngle

Create a new SVGAngle (degrees)

#
SVGAngle::to_degrees

fn SVGAngle::to_degrees(self : SVGAngle) -> Double

Convert SVGAngle to degrees

#
SVGAngle::to_radians

fn SVGAngle::to_radians(self : SVGAngle) -> Double

Convert SVGAngle to radians

#
SVGAngleType

pub enum SVGAngleType {
Unknown
Unspecified
Deg
Rad
Grad
Turn
} derive(Eq,
Debug
)

SVG Angle unit types

#
SVGLength

pub struct SVGLength {
unit_type : SVGLengthType
value : Double
value_in_specified_units : Double
} derive(Eq,
Debug
)

SVGLength - represents a length value with unit
impl Show for SVGLength

#
SVGLength::new

fn SVGLength::new(value : Double) -> SVGLength

Create a new SVGLength (unitless)

#
SVGLength::to_user_units

fn SVGLength::to_user_units(self : SVGLength, dpi? : Double, font_size? : Double) -> Double

Convert SVGLength to user units (pixels)

#
SVGLengthType

pub enum SVGLengthType {
Unknown
Number
Percentage
Ems
Exs
Px
Cm
Mm
In
Pt
Pc
} derive(Eq,
Debug
)

SVG Length unit types

#
SVGMatrix

pub struct SVGMatrix {
a : Double
b : Double
c : Double
d : Double
e : Double
f : Double
} derive(Eq,
Debug
)

SVGMatrix - 2D transformation matrix for SVG Represents a 3x3 matrix: | a c e | | b d f | | 0 0 1 |
impl Show for SVGMatrix

#
SVGMatrix::flip_x

fn SVGMatrix::flip_x(self : SVGMatrix) -> SVGMatrix

Flip on X axis

#
SVGMatrix::flip_y

fn SVGMatrix::flip_y(self : SVGMatrix) -> SVGMatrix

Flip on Y axis

#
SVGMatrix::identity

fn SVGMatrix::identity() -> SVGMatrix

Create an identity matrix

#
SVGMatrix::inverse

fn SVGMatrix::inverse(self : SVGMatrix) -> SVGMatrix?

Get the inverse of this matrix

#
SVGMatrix::multiply

fn SVGMatrix::multiply(self : SVGMatrix, other : SVGMatrix) -> SVGMatrix

Multiply this matrix by another matrix (this * other)

#
SVGMatrix::new

fn SVGMatrix::new(a : Double, b : Double, c : Double, d : Double, e : Double, f : Double) -> SVGMatrix

Create a new SVGMatrix with specified values

#
SVGMatrix::rotate

fn SVGMatrix::rotate(angle : Double) -> SVGMatrix

Create a rotation matrix (angle in radians)

#
SVGMatrix::rotate_deg

fn SVGMatrix::rotate_deg(angle_deg : Double) -> SVGMatrix

Create a rotation matrix (angle in degrees)

#
SVGMatrix::rotate_self

fn SVGMatrix::rotate_self(self : SVGMatrix, angle : Double) -> SVGMatrix

Apply rotation to this matrix (returns new matrix)

#
SVGMatrix::scale

fn SVGMatrix::scale(sx : Double, sy : Double) -> SVGMatrix

Create a scale matrix

#
SVGMatrix::scale_self

fn SVGMatrix::scale_self(self : SVGMatrix, sx : Double, sy : Double) -> SVGMatrix

Apply scale to this matrix (returns new matrix)

#
SVGMatrix::scale_uniform

fn SVGMatrix::scale_uniform(s : Double) -> SVGMatrix

Create a uniform scale matrix

#
SVGMatrix::skew_x

fn SVGMatrix::skew_x(angle : Double) -> SVGMatrix

Create a skew X matrix (angle in radians)

#
SVGMatrix::skew_y

fn SVGMatrix::skew_y(angle : Double) -> SVGMatrix

Create a skew Y matrix (angle in radians)

#
SVGMatrix::translate

fn SVGMatrix::translate(tx : Double, ty : Double) -> SVGMatrix

Create a translation matrix

#
SVGMatrix::translate_self

fn SVGMatrix::translate_self(self : SVGMatrix, tx : Double, ty : Double) -> SVGMatrix

Apply translation to this matrix (returns new matrix)

#
SVGNumber

pub struct SVGNumber {
value : Double
} derive(Eq,
Debug
)

SVGNumber - represents an animated number value
impl Show for SVGNumber

#
SVGNumber::new

fn SVGNumber::new(value : Double) -> SVGNumber

Create a new SVGNumber

#
SVGPoint

pub struct SVGPoint {
x : Double
y : Double
} derive(Eq,
Debug
)

SVGPoint - represents a point in SVG coordinate space Has matrixTransform method for coordinate transformations
impl Show for SVGPoint

#
SVGPoint::matrix_transform

fn SVGPoint::matrix_transform(self : SVGPoint, matrix : SVGMatrix) -> SVGPoint

Transform this point by a matrix

#
SVGPoint::new

fn SVGPoint::new(x : Double, y : Double) -> SVGPoint

Create a new SVGPoint

#
SVGPoint::origin

fn SVGPoint::origin() -> SVGPoint

Create an SVGPoint at origin (0, 0)

#
SVGRect

pub struct SVGRect {
x : Double
y : Double
width : Double
height : Double
} derive(Eq,
Debug
)

SVGRect - represents a rectangle in SVG coordinate space Used by getBBox(), getClientRect(), and other SVG methods
impl Show for SVGRect

#
SVGRect::empty

fn SVGRect::empty() -> SVGRect

Create an empty SVGRect (0, 0, 0, 0)

#
SVGRect::from_rect

fn SVGRect::from_rect(rect : Rect) -> SVGRect

Create SVGRect from Rect

#
SVGRect::new

fn SVGRect::new(x : Double, y : Double, width : Double, height : Double) -> SVGRect

Create a new SVGRect

#
SVGRect::to_rect

fn SVGRect::to_rect(self : SVGRect) -> Rect

Convert SVGRect to Rect

#
SVGTransform

pub struct SVGTransform {
transform_type : SVGTransformType
matrix : SVGMatrix
angle : Double
} derive(Eq,
Debug
)

SVGTransform - represents a single transformation

#
SVGTransform::from_matrix

fn SVGTransform::from_matrix(matrix : SVGMatrix) -> SVGTransform

Create an SVGTransform from a matrix

#
SVGTransform::rotate

fn SVGTransform::rotate(angle : Double, cx? : Double, cy? : Double) -> SVGTransform

Create a rotate transform (angle in degrees)

#
SVGTransform::scale

fn SVGTransform::scale(sx : Double, sy : Double) -> SVGTransform

Create a scale transform

#
SVGTransform::skew_x

fn SVGTransform::skew_x(angle : Double) -> SVGTransform

Create a skewX transform (angle in degrees)

#
SVGTransform::skew_y

fn SVGTransform::skew_y(angle : Double) -> SVGTransform

Create a skewY transform (angle in degrees)

#
SVGTransform::translate

fn SVGTransform::translate(tx : Double, ty : Double) -> SVGTransform

Create a translate transform

#
SVGTransformType

pub enum SVGTransformType {
Unknown
Matrix
Translate
Scale
Rotate
SkewX
SkewY
} derive(Eq,
Debug
)

SVG Transform types

#
ScrollState

pub struct ScrollState {
scroll_left : Double
scroll_top : Double
scroll_width : Double
scroll_height : Double
client_width : Double
client_height : Double
} derive(Eq,
Debug
)

Scroll state for a scrollable element
impl Show for ScrollState

#
ScrollState::can_scroll_x

fn ScrollState::can_scroll_x(self : ScrollState) -> Bool

Check if horizontal scrolling is possible

#
ScrollState::can_scroll_y

fn ScrollState::can_scroll_y(self : ScrollState) -> Bool

Check if vertical scrolling is possible

#
ScrollState::default

fn ScrollState::default() -> ScrollState

Create a default ScrollState (no scrolling)

#
ScrollState::max_scroll_left

fn ScrollState::max_scroll_left(self : ScrollState) -> Double

Get maximum scroll position (horizontal)

#
ScrollState::max_scroll_top

fn ScrollState::max_scroll_top(self : ScrollState) -> Double

Get maximum scroll position (vertical)

#
ScrollState::new

fn ScrollState::new(scroll_width : Double, scroll_height : Double, client_width : Double, client_height : Double) -> ScrollState

Create a new ScrollState

#
ScrollState::scroll_by

fn ScrollState::scroll_by(self : ScrollState, delta_x : Double, delta_y : Double) -> ScrollState

Scroll by delta (relative scroll)

#
ScrollState::scroll_to

fn ScrollState::scroll_to(self : ScrollState, left : Double, top : Double) -> ScrollState

Set scroll position (clamped to valid range)

#
ShadowRootInit

pub struct ShadowRootInit {
mode : String
delegates_focus : Bool
slot_assignment : String
clonable : Bool
serializable : Bool
} derive(Eq,
Debug
)

#
ShadowRootInit::default

fn ShadowRootInit::default(mode? : String) -> ShadowRootInit

#
ShadowRootInit::new

fn ShadowRootInit::new(mode~ : String, delegates_focus? : Bool, slot_assignment? : String, clonable? : Bool, serializable? : Bool) -> ShadowRootInit

#
create_svg_angle

fn create_svg_angle() -> SVGAngle

Create a zero SVGAngle

#
create_svg_length

fn create_svg_length() -> SVGLength

Create a zero SVGLength

#
create_svg_matrix

fn create_svg_matrix() -> SVGMatrix

Create a new SVGMatrix object (identity matrix) Equivalent to SVGSVGElement.createSVGMatrix()

#
create_svg_matrix_with

fn create_svg_matrix_with(a : Double, b : Double, c : Double, d : Double, e : Double, f : Double) -> SVGMatrix

Create a new SVGMatrix with values

#
create_svg_number

fn create_svg_number() -> SVGNumber

Create a zero SVGNumber

#
create_svg_point

fn create_svg_point() -> SVGPoint

Create a new SVGPoint object Equivalent to SVGSVGElement.createSVGPoint()

#
create_svg_point_with

fn create_svg_point_with(x : Double, y : Double) -> SVGPoint

Create a new SVGPoint with values

#
create_svg_rect

fn create_svg_rect() -> SVGRect

Create a new SVGRect object Equivalent to SVGSVGElement.createSVGRect()

#
create_svg_rect_with

fn create_svg_rect_with(x : Double, y : Double, width : Double, height : Double) -> SVGRect

Create a new SVGRect with values

#
create_svg_transform

fn create_svg_transform() -> SVGTransform

Create a new SVGTransform

#
create_svg_transform_rotate

fn create_svg_transform_rotate(angle : Double) -> SVGTransform

Create a rotation SVGTransform

#
create_svg_transform_scale

fn create_svg_transform_scale(sx : Double, sy : Double) -> SVGTransform

Create a scale SVGTransform

#
create_svg_transform_translate

fn create_svg_transform_translate(tx : Double, ty : Double) -> SVGTransform

Create a translation SVGTransform

#
is_layout_property

fn is_layout_property(prop : String) -> Bool

Check if a CSS property affects layout (vs paint-only)