From 2d7ab68217b725ed93e2034eca9e893d673f7ee4 Mon Sep 17 00:00:00 2001 From: jahielkomu Date: Sun, 31 Mar 2024 19:43:22 +0300 Subject: [PATCH] Revert "Updated fixes to clippy warnings in components/script" This reverts commit 5780dc3a0a8d51d4b36f56c095d0cc6c63c0cb36. --- components/script/dom/window.rs | 1 - components/script/layout_dom/node.rs | 4 +++- components/script/layout_dom/shadow_root.rs | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 0dd190ef2f1..efb18a8d285 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2520,7 +2520,6 @@ impl Window { impl Window { #[allow(unsafe_code)] - #[allow(clippy::too_many_arguments)] pub fn new( runtime: Rc, script_chan: MainThreadScriptChan, diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs index c331f4aa5e3..2b30f678a09 100644 --- a/components/script/layout_dom/node.rs +++ b/components/script/layout_dom/node.rs @@ -97,7 +97,9 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoLayoutNode<'dom, LayoutDataType phantom: PhantomData, } } - + /// # Safety + /// + /// This function should not be called if there is no TrustedNodeAddress. pub unsafe fn new(address: &TrustedNodeAddress) -> Self { ServoLayoutNode::from_layout_js(LayoutDom::from_trusted_node_address(*address)) } diff --git a/components/script/layout_dom/shadow_root.rs b/components/script/layout_dom/shadow_root.rs index 090d1e84f8b..3da0e2cc537 100644 --- a/components/script/layout_dom/shadow_root.rs +++ b/components/script/layout_dom/shadow_root.rs @@ -71,6 +71,9 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoShadowRoot<'dom, LayoutDataType } } + /// # Safety + /// + /// This function should not mutate StyleSharedRwLockReadGuard. pub unsafe fn flush_stylesheets( &self, stylist: &mut Stylist,