diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2023-09-11 21:16:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-11 19:16:54 +0000 |
commit | aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4 (patch) | |
tree | 68dec1a9d53f4ed564843a9580fba70bf90dbef1 /components/layout_2020/fragment_tree | |
parent | 413da4ca69d3013528c09bbaf38629a72384372d (diff) | |
download | servo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.tar.gz servo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.zip |
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting
* Reformat all imports
Diffstat (limited to 'components/layout_2020/fragment_tree')
6 files changed, 27 insertions, 19 deletions
diff --git a/components/layout_2020/fragment_tree/base_fragment.rs b/components/layout_2020/fragment_tree/base_fragment.rs index 6104c9af547..f0921592517 100644 --- a/components/layout_2020/fragment_tree/base_fragment.rs +++ b/components/layout_2020/fragment_tree/base_fragment.rs @@ -2,13 +2,14 @@ * 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 crate::layout_debug::DebugId; use bitflags::bitflags; use gfx_traits::{combine_id_with_fragment_type, FragmentType}; use serde::Serialize; use style::dom::OpaqueNode; use style::selector_parser::PseudoElement; +use crate::layout_debug::DebugId; + /// This data structure stores fields that are common to all non-base /// Fragment types and should generally be the first member of all /// concrete fragments. diff --git a/components/layout_2020/fragment_tree/box_fragment.rs b/components/layout_2020/fragment_tree/box_fragment.rs index 4ba007a79a2..a4a62c8ee64 100644 --- a/components/layout_2020/fragment_tree/box_fragment.rs +++ b/components/layout_2020/fragment_tree/box_fragment.rs @@ -2,10 +2,6 @@ * 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 super::{BaseFragment, BaseFragmentInfo, CollapsedBlockMargins, Fragment}; -use crate::cell::ArcRefCell; -use crate::geom::flow_relative::{Rect, Sides}; -use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize}; use gfx_traits::print_tree::PrintTree; use serde::Serialize; use servo_arc::Arc as ServoArc; @@ -15,6 +11,11 @@ use style::properties::ComputedValues; use style::values::computed::{CSSPixelLength, Length, LengthPercentage, LengthPercentageOrAuto}; use style::Zero; +use super::{BaseFragment, BaseFragmentInfo, CollapsedBlockMargins, Fragment}; +use crate::cell::ArcRefCell; +use crate::geom::flow_relative::{Rect, Sides}; +use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize}; + #[derive(Serialize)] pub(crate) struct BoxFragment { pub base: BaseFragment, diff --git a/components/layout_2020/fragment_tree/containing_block.rs b/components/layout_2020/fragment_tree/containing_block.rs index 82a205fd2d5..41b4910bdbf 100644 --- a/components/layout_2020/fragment_tree/containing_block.rs +++ b/components/layout_2020/fragment_tree/containing_block.rs @@ -2,9 +2,10 @@ * 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 crate::fragment_tree::Fragment; use style::computed_values::position::T as ComputedPosition; +use crate::fragment_tree::Fragment; + /// A data structure used to track the containing block when recursing /// through the Fragment tree. It tracks the three types of containing /// blocks (for all descendants, for absolute and fixed position diff --git a/components/layout_2020/fragment_tree/fragment.rs b/components/layout_2020/fragment_tree/fragment.rs index 6b8e788f0f1..bfe9e0358db 100644 --- a/components/layout_2020/fragment_tree/fragment.rs +++ b/components/layout_2020/fragment_tree/fragment.rs @@ -2,18 +2,14 @@ * 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 super::{BaseFragment, BoxFragment, ContainingBlockManager, HoistedSharedFragment, Tag}; -use crate::cell::ArcRefCell; -use crate::geom::flow_relative::{Rect, Sides}; -use crate::geom::PhysicalRect; -use crate::style_ext::ComputedValuesExt; +use std::sync::Arc; + use gfx::font::FontMetrics as GfxFontMetrics; use gfx::text::glyph::GlyphStore; use gfx_traits::print_tree::PrintTree; use msg::constellation_msg::{BrowsingContextId, PipelineId}; use serde::Serialize; use servo_arc::Arc as ServoArc; -use std::sync::Arc; use style::logical_geometry::WritingMode; use style::properties::ComputedValues; use style::values::computed::Length; @@ -21,6 +17,12 @@ use style::values::specified::text::TextDecorationLine; use style::Zero; use webrender_api::{FontInstanceKey, ImageKey}; +use super::{BaseFragment, BoxFragment, ContainingBlockManager, HoistedSharedFragment, Tag}; +use crate::cell::ArcRefCell; +use crate::geom::flow_relative::{Rect, Sides}; +use crate::geom::PhysicalRect; +use crate::style_ext::ComputedValuesExt; + #[derive(Serialize)] pub(crate) enum Fragment { Box(BoxFragment), diff --git a/components/layout_2020/fragment_tree/fragment_tree.rs b/components/layout_2020/fragment_tree/fragment_tree.rs index ce39f05ad01..023344a1b6c 100644 --- a/components/layout_2020/fragment_tree/fragment_tree.rs +++ b/components/layout_2020/fragment_tree/fragment_tree.rs @@ -2,11 +2,6 @@ * 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 super::{ContainingBlockManager, Fragment, Tag}; -use crate::cell::ArcRefCell; -use crate::display_list::StackingContext; -use crate::flow::CanvasBackground; -use crate::geom::PhysicalRect; use app_units::Au; use euclid::default::{Point2D, Rect, Size2D}; use fxhash::FxHashSet; @@ -17,6 +12,12 @@ use style::dom::OpaqueNode; use style::values::computed::Length; use webrender_api::units; +use super::{ContainingBlockManager, Fragment, Tag}; +use crate::cell::ArcRefCell; +use crate::display_list::StackingContext; +use crate::flow::CanvasBackground; +use crate::geom::PhysicalRect; + #[derive(Serialize)] pub struct FragmentTree { /// Fragments at the top-level of the tree. diff --git a/components/layout_2020/fragment_tree/hoisted_shared_fragment.rs b/components/layout_2020/fragment_tree/hoisted_shared_fragment.rs index 48a90d73c64..41bcc9ddb05 100644 --- a/components/layout_2020/fragment_tree/hoisted_shared_fragment.rs +++ b/components/layout_2020/fragment_tree/hoisted_shared_fragment.rs @@ -2,11 +2,13 @@ * 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 super::Fragment; -use crate::{cell::ArcRefCell, geom::flow_relative::Vec2}; use serde::Serialize; use style::values::computed::{Length, LengthPercentage}; +use super::Fragment; +use crate::cell::ArcRefCell; +use crate::geom::flow_relative::Vec2; + /// A reference to a Fragment which is shared between `HoistedAbsolutelyPositionedBox` /// and its placeholder `AbsoluteOrFixedPositionedFragment` in the original tree position. /// This will be used later in order to paint this hoisted box in tree order. |