From dd9f62adcc2db74e473ba1d385c2005b9c0fd25f Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 9 Apr 2024 08:43:48 +0200 Subject: chore: Clean up use of `gfx` and `constellation` types (#31981) This change contains three semi-related clean ups: 1. the `to_webrender()` and `from_webrender()` functions on Pipeline are turned into more-idiomatic `From` and `Into` implementations. 2. `combine_id_with_fragment_type` now returns a `u64` as that is what is expected for all callers and not a `usize`. 3. The `query_scroll_id` query is removed entirely. The `ExternalScrollId` that this queries is easily generated directly from the node's opaque id. Querying into layout isn't necessary at all. --- components/layout_2020/display_list/mod.rs | 2 +- components/layout_2020/fragment_tree/base_fragment.rs | 2 +- components/layout_2020/query.rs | 10 ---------- 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'components/layout_2020') diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index d192eb8242a..19b60ba1691 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -291,7 +291,7 @@ impl Fragment { spatial_id: common.spatial_id, clip_chain_id: common.clip_chain_id, }, - iframe.pipeline_id.to_webrender(), + iframe.pipeline_id.into(), true, ); }, diff --git a/components/layout_2020/fragment_tree/base_fragment.rs b/components/layout_2020/fragment_tree/base_fragment.rs index b5e7fb3fbc5..872d34cc6dd 100644 --- a/components/layout_2020/fragment_tree/base_fragment.rs +++ b/components/layout_2020/fragment_tree/base_fragment.rs @@ -126,6 +126,6 @@ impl Tag { Some(PseudoElement::After) => FragmentType::AfterPseudoContent, _ => FragmentType::FragmentBody, }; - combine_id_with_fragment_type(self.node.id(), fragment_type) as u64 + combine_id_with_fragment_type(self.node.id(), fragment_type) } } diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index 48e052996ff..d53da05677a 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -9,7 +9,6 @@ use app_units::Au; use euclid::default::{Point2D, Rect}; use euclid::{SideOffsets2D, Size2D, Vector2D}; use log::warn; -use msg::constellation_msg::PipelineId; use script_layout_interface::wrapper_traits::{ LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode, }; @@ -31,7 +30,6 @@ use style::stylist::RuleInclusion; use style::traversal::resolve_style; use style::values::generics::font::LineHeight; use style_traits::{ParsingMode, ToCss}; -use webrender_api::ExternalScrollId; use crate::fragment_tree::{Fragment, FragmentFlags, FragmentTree, Tag}; @@ -71,14 +69,6 @@ pub fn process_node_geometry_request( } } -pub fn process_node_scroll_id_request<'dom>( - id: PipelineId, - requested_node: impl LayoutNode<'dom>, -) -> ExternalScrollId { - let layout_node = requested_node.to_threadsafe(); - layout_node.generate_scroll_id(id) -} - /// pub fn process_node_scroll_area_request( requested_node: Option, -- cgit v1.2.3