/// Response for GetLibraries — list of registered component libraries (without component details)
/// Response for GetVirtualViewStates - lists all tracked VirtualViews and their internal state
/// * `file_open`: `{"path": "..."}` or `null` (cancelled) - the next `FileDialog::open_file` /
/// The `AZ_DEBUG` environment variable should be set to a port number (e.g., `AZ_DEBUG=8765`).
pub(crate) static LAST_RESPONSE: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None);
if let Some(bad) = reject_unknown_params("assert_node_count", params, &["selector", "expected"])
/// * `max_relayouts` bounds `relayout_iterations`, the EVENT-pass depth. `0` means "no state delta
/// * `max_layout_passes` bounds `layout_passes`, i.e. how many times layout ACTUALLY ran, whichever
/// scheduler asked for it. This is the one to use for "the engine schedules no relayout" over a
/// * `max_virtual_view_size_passes` bounds `virtual_view_size_passes`: the extra layout passes
/// content-sized `VirtualView`s cost (one per host dom whose views reported a size the solver had
/// not seen). `0` in steady state is the invariant; a label re-rendered with longer text costs
// * X4 — the second `Option<DragContext>` this pair named was deleted in 2026-07. The seam survives
// as `DragState::from_context`, a derived view that every reader of the public drag API sees, so
// * X7 — an issued `ScrollAdjustment` is still not retained, and that half stays unobservable. What
fn dom_node_is_live(lw: &azul_layout::window::LayoutWindow, id: azul_core::dom::DomNodeId) -> bool {
if lw.text_edit_manager.multi_cursor.is_none() && lw.text_edit_manager.blink.blink_timer_active
if let Some(bad) = reject_unknown_params("assert_state_machines_idle", params, &["damage"]) {
/// * `managers` — which managers to sweep for dangling keys (X10). Default: all supported. Known:
/// `scroll`, `hover`, `focus`, `gesture`, `selection`, `text_edit`, `virtual_view`, `undo_redo`.
/// * `cross` — which pairwise invariants to check. Default: `["X2","X3","X5","X6","X9","X10"]`, the
/// six that hold unconditionally. `X1`, `X4`, `X7` and `X8` are implemented but OPT-IN, because
/// each one is a statement about an interaction that must actually have happened; requesting one
/// without performing that interaction fails loudly rather than passing on an empty premise. See
if lw.gpu_state_manager.scrollbar_fade_active && lw.scroll_manager.state_keys().is_empty() {
fn check_x4_drag_view_agrees(d: &azul_core::drag::DragContext, checked: &mut usize) -> Vec<String> {
/// redundant with the offset that is recorded, and rendering a clock value into a digest makes
/// * `ScrollManager::scrollbar_states`: private, and recomputed from geometry every frame — it is a
/// * `GpuValueCache`'s animated VALUES: they change every frame of a running animation, so they
/// would report "gpu_state moved" for every tick of a fade the scenario asked for. The KEYS are
/// * `VirtualViewState`'s per-view internals and geolocation's private pending queues: no accessor
fn fp_gesture(m: &azul_layout::managers::gesture::GestureAndDragManager) -> ManagerFingerprint {
fn fp_text_edit(m: &azul_layout::managers::text_edit::TextEditManager) -> ManagerFingerprint {
fn fp_text_input(m: &azul_layout::managers::text_input::TextInputManager) -> ManagerFingerprint {
fn fp_undo_redo(m: &azul_layout::managers::undo_redo::UndoRedoManager) -> ManagerFingerprint {
fn fp_gpu_state(m: &azul_layout::managers::gpu_state::GpuStateManager) -> ManagerFingerprint {
fn fp_permission(m: &azul_layout::managers::permission::PermissionManager) -> ManagerFingerprint {
fn fp_clipboard(m: &azul_layout::managers::clipboard::ClipboardManager) -> ManagerFingerprint {
fn fp_file_drop(m: &azul_layout::managers::file_drop::FileDropManager) -> ManagerFingerprint {
fn fp_biometric(m: &azul_layout::managers::biometric::BiometricManager) -> ManagerFingerprint {
fn fp_eyedropper(m: &azul_layout::managers::eyedropper::EyedropperManager) -> ManagerFingerprint {
/// * `changed` — the exact set of managers expected to have moved (required; `[]` means "this op
/// * `min_populated` — optionally require that at least N managers are holding non-empty state
/// right now. Without it, two empty snapshots compare equal and the assertion reports "nothing
pub(crate) fn e2e_reset_composition_trace(callback_info: &azul_layout::callbacks::CallbackInfo) {
/// 1. `assert_damage_covers_changes` PASSES TRIVIALLY when the damage is `Full` ("a full repaint
/// trivially covers every changed pixel"). Here a full repaint is still measured for TIGHTNESS,
/// 3. It adds the plan's TIGHTNESS bound: `area(damage) <= max_overpaint_ratio * area(bbox of the
/// 4. With `pixel_identity: true` it additionally compares the damage-driven framebuffer against an
/// * inside the intersection of the two frames, a pixel changed iff it differs from the snapshot —
/// * every pixel of the new frame OUTSIDE that intersection is newly exposed, so it changed BY
fn build_component_registry(map_ref: &azul_core::xml::ComponentMap) -> ComponentRegistryResponse {
fn styled_dom_to_render_tree(styled_dom: &azul_core::styled_dom::StyledDom) -> serde_json::Value {
/// Convert a single `serde_json::Value` to a `ComponentDefaultValue` given the expected type.
/// Convert a `ComponentFieldType` to a JSON-friendly string for the debug protocol (legacy flat
fn default_value_to_opt_string(dv: &azul_core::xml::OptionComponentDefaultValue) -> Option<String> {
fn parse_field_type_from_string(s: &str) -> Result<azul_core::xml::ComponentFieldType, String> {
/// Validate a field name: must be a valid identifier (alphanumeric + underscore, not starting with
AzRefAny data = AzRefAny_newC((AzGlVoidPtrConst){{ .ptr = NULL }}, 0, 1, 0, data_type, NULL, 0, 0);
/// * It MANUFACTURES the damage the test then measures. Delete the engine's `:hover` invalidation
/// path entirely and a `mouse_move` still repaints the window, still resolves `:hover` during the
/// rebuild and still reports non-empty damage — so `assert_changed` goes green against an engine
/// * It makes `dom_regenerations >= 1` unconditionally, so no test can ever assert that an inert
azul_layout::solver3::display_list::DisplayListItem::Text { glyphs, font_size_px, color, clip_rect, .. } => {
azul_layout::solver3::display_list::DisplayListItem::TextLayout { bounds, font_size_px, color, .. } => {
azul_layout::solver3::display_list::DisplayListItem::Border { bounds, colors, widths, .. } => {
azul_css::css::CssPropertyValue::Exact(c) => Some(format!("#{:02x}{:02x}{:02x}{:02x}", c.inner.r, c.inner.g, c.inner.b, c.inner.a)),
azul_css::css::CssPropertyValue::Exact(c) => Some(format!("#{:02x}{:02x}{:02x}{:02x}", c.inner.r, c.inner.g, c.inner.b, c.inner.a)),
azul_css::css::CssPropertyValue::Exact(c) => Some(format!("#{:02x}{:02x}{:02x}{:02x}", c.inner.r, c.inner.g, c.inner.b, c.inner.a)),
azul_css::css::CssPropertyValue::Exact(c) => Some(format!("#{:02x}{:02x}{:02x}{:02x}", c.inner.r, c.inner.g, c.inner.b, c.inner.a)),
azul_css::css::CssPropertyValue::Exact(c) => Some(c.inner.to_pixels_internal(0.0, 16.0, 16.0)),
azul_css::css::CssPropertyValue::Exact(c) => Some(c.inner.to_pixels_internal(0.0, 16.0, 16.0)),
azul_css::css::CssPropertyValue::Exact(c) => Some(c.inner.to_pixels_internal(0.0, 16.0, 16.0)),
azul_css::css::CssPropertyValue::Exact(c) => Some(c.inner.to_pixels_internal(0.0, 16.0, 16.0)),
azul_layout::solver3::display_list::DisplayListItem::ScrollBar { bounds, color, orientation, .. } => {
"track:({:.1},{:.1},{:.1}x{:.1}) thumb:({:.1},{:.1},{:.1}x{:.1}) track_color:#{:02x}{:02x}{:02x}{:02x} thumb_color:#{:02x}{:02x}{:02x}{:02x} opacity_key:{} transform_key:{}",
info.thumb_transform_key.as_ref().map(|k| format!("{}", k.id)).unwrap_or_else(|| "none".to_string()),
azul_layout::solver3::display_list::DisplayListItem::PushStackingContext { z_index, bounds } => {
/// 1. The DIFF must report both failure directions: a manager that moved without being listed (the
/// leak), and a listed manager that did not move (a scenario that has quietly stopped exercising
/// 2. Every FINGERPRINT must actually move when its manager is written. A fingerprint that ignores
/// the field somebody later leaks into is exactly the "cannot fail" defect at the level below