aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/documentorshadowroot.rs
diff options
context:
space:
mode:
authorchickenleaf <lashwinib@gmail.com>2024-10-21 17:58:56 +0530
committerGitHub <noreply@github.com>2024-10-21 12:28:56 +0000
commit9acb25521e433bdea49866e4ecb6a9f4e90b0663 (patch)
tree96c99cdf3e5f4c157dbfb08eff8240d9dff55bfc /components/script/dom/documentorshadowroot.rs
parent66695d2f7ee25782d3edfca32b74ff14bc9faa84 (diff)
downloadservo-9acb25521e433bdea49866e4ecb6a9f4e90b0663.tar.gz
servo-9acb25521e433bdea49866e4ecb6a9f4e90b0663.zip
CanGc changes from fontfaceset.rs (#33920)
* CanGc changes from fontfaceset.rs Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Update components/script/dom/bindings/codegen/Bindings.conf Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: chickenleaf <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/documentorshadowroot.rs')
-rw-r--r--components/script/dom/documentorshadowroot.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/components/script/dom/documentorshadowroot.rs b/components/script/dom/documentorshadowroot.rs
index e3eb4a34de1..7e9e58fe3a3 100644
--- a/components/script/dom/documentorshadowroot.rs
+++ b/components/script/dom/documentorshadowroot.rs
@@ -25,6 +25,7 @@ use crate::dom::element::Element;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::{self, Node, VecPreOrderInsertionHelper};
use crate::dom::window::Window;
+use crate::script_runtime::CanGc;
use crate::stylesheet_set::StylesheetSetRef;
#[derive(Clone, JSTraceable, MallocSizeOf)]
@@ -90,8 +91,12 @@ impl DocumentOrShadowRoot {
&self,
client_point: &Point2D<f32>,
query_type: NodesFromPointQueryType,
+ can_gc: CanGc,
) -> Vec<UntrustedNodeAddress> {
- if !self.window.layout_reflow(QueryMsg::NodesFromPointQuery) {
+ if !self
+ .window
+ .layout_reflow(QueryMsg::NodesFromPointQuery, can_gc)
+ {
return vec![];
};
@@ -108,6 +113,7 @@ impl DocumentOrShadowRoot {
y: Finite<f64>,
document_element: Option<DomRoot<Element>>,
has_browsing_context: bool,
+ can_gc: CanGc,
) -> Option<DomRoot<Element>> {
let x = *x as f32;
let y = *y as f32;
@@ -123,7 +129,7 @@ impl DocumentOrShadowRoot {
}
match self
- .nodes_from_point(point, NodesFromPointQueryType::Topmost)
+ .nodes_from_point(point, NodesFromPointQueryType::Topmost, can_gc)
.first()
{
Some(address) => {
@@ -147,6 +153,7 @@ impl DocumentOrShadowRoot {
y: Finite<f64>,
document_element: Option<DomRoot<Element>>,
has_browsing_context: bool,
+ can_gc: CanGc,
) -> Vec<DomRoot<Element>> {
let x = *x as f32;
let y = *y as f32;
@@ -163,7 +170,7 @@ impl DocumentOrShadowRoot {
}
// Step 1 and Step 3
- let nodes = self.nodes_from_point(point, NodesFromPointQueryType::All);
+ let nodes = self.nodes_from_point(point, NodesFromPointQueryType::All, can_gc);
let mut elements: Vec<DomRoot<Element>> = nodes
.iter()
.flat_map(|&untrusted_node_address| {