Nacre/vendor/servo-script/dom/testing/accessibilityupdateresult.rs
astar76 0ecfd0f573 S031: root due timers in vendored servo-script (R5-01 SIGSEGV), crash-adblock regression smoke
fire_timer moved due timers into an unrooted Vec; a GC inside one callback swept
the functions of the timers still waiting. Heavy-web reruns and cargo test still pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:38:47 -06:00

74 lines
2.1 KiB
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
use js::context::JSContext;
use script_bindings::reflector::{Reflector, reflect_dom_object};
use crate::dom::bindings::codegen::Bindings::ServoTestUtilsBinding::AccessibilityUpdateResultMethods;
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
#[dom_struct]
pub(crate) struct AccessibilityUpdateResult {
reflector_: Reflector,
nodes_updated_from_dom: u32,
nodes_updated_from_tree: u32,
nodes_updated_bounds: u32,
nodes_in_tree_update: u32,
}
impl AccessibilityUpdateResult {
pub(crate) fn new_inherited(
nodes_updated_from_dom: u32,
nodes_updated_from_tree: u32,
nodes_updated_bounds: u32,
nodes_in_tree_update: u32,
) -> Self {
Self {
reflector_: Reflector::new(),
nodes_updated_from_dom,
nodes_updated_from_tree,
nodes_updated_bounds,
nodes_in_tree_update,
}
}
pub(crate) fn new(
cx: &mut JSContext,
global: &GlobalScope,
nodes_updated_from_dom: u32,
nodes_updated_from_tree: u32,
nodes_updated_bounds: u32,
nodes_in_tree_update: u32,
) -> DomRoot<Self> {
reflect_dom_object(
cx,
Box::new(Self::new_inherited(
nodes_updated_from_dom,
nodes_updated_from_tree,
nodes_updated_bounds,
nodes_in_tree_update,
)),
global,
)
}
}
impl AccessibilityUpdateResultMethods<crate::DomTypeHolder> for AccessibilityUpdateResult {
fn NodesUpdatedFromDom(&self) -> u32 {
self.nodes_updated_from_dom
}
fn NodesUpdatedFromTree(&self) -> u32 {
self.nodes_updated_from_tree
}
fn NodesUpdatedBounds(&self) -> u32 {
self.nodes_updated_bounds
}
fn NodesInTreeUpdate(&self) -> u32 {
self.nodes_in_tree_update
}
}