diff options
Diffstat (limited to 'components/layout/display_list')
-rw-r--r-- | components/layout/display_list/background.rs | 3 | ||||
-rw-r--r-- | components/layout/display_list/border.rs | 10 | ||||
-rw-r--r-- | components/layout/display_list/builder.rs | 57 | ||||
-rw-r--r-- | components/layout/display_list/gradient.rs | 3 | ||||
-rw-r--r-- | components/layout/display_list/items.rs | 11 | ||||
-rw-r--r-- | components/layout/display_list/mod.rs | 9 | ||||
-rw-r--r-- | components/layout/display_list/webrender_helpers.rs | 7 |
7 files changed, 50 insertions, 50 deletions
diff --git a/components/layout/display_list/background.rs b/components/layout/display_list/background.rs index 4f37dcf25c3..4c56deabede 100644 --- a/components/layout/display_list/background.rs +++ b/components/layout/display_list/background.rs @@ -2,7 +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 crate::display_list::border; use app_units::Au; use euclid::default::{Point2D, Rect, SideOffsets2D, Size2D}; use style::computed_values::background_attachment::single_value::T as BackgroundAttachment; @@ -13,6 +12,8 @@ use style::values::computed::{BackgroundSize, NonNegativeLengthPercentageOrAuto} use style::values::specified::background::BackgroundRepeatKeyword; use webrender_api::BorderRadius; +use crate::display_list::border; + /// Placment information for both image and gradient backgrounds. #[derive(Clone, Copy, Debug)] pub struct BackgroundPlacement { diff --git a/components/layout/display_list/border.rs b/components/layout/display_list/border.rs index 14ca2abe84f..a77c6516155 100644 --- a/components/layout/display_list/border.rs +++ b/components/layout/display_list/border.rs @@ -2,20 +2,22 @@ * 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::display_list::ToLayout; use app_units::Au; use euclid::default::{Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D as UntypedSize2D}; use euclid::{SideOffsets2D, Size2D}; use style::computed_values::border_image_outset::T as BorderImageOutset; use style::properties::style_structs::Border; -use style::values::computed::NumberOrPercentage; -use style::values::computed::{BorderCornerRadius, BorderImageWidth}; -use style::values::computed::{BorderImageSideWidth, NonNegativeLengthOrNumber}; +use style::values::computed::{ + BorderCornerRadius, BorderImageSideWidth, BorderImageWidth, NonNegativeLengthOrNumber, + NumberOrPercentage, +}; use style::values::generics::rect::Rect as StyleRect; use style::values::generics::NonNegative; use webrender_api::units::{LayoutSideOffsets, LayoutSize}; use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, NormalBorder}; +use crate::display_list::ToLayout; + /// Computes a border radius size against the containing size. /// /// Note that percentages in `border-radius` are resolved against the relevant diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index db6b1d92724..6decaf26011 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -8,37 +8,16 @@ //! list building, as the actual painting does not happen here—only deciding *what* we're going to //! paint. -use crate::block::BlockFlow; -use crate::context::LayoutContext; -use crate::display_list::background::{self, get_cyclic}; -use crate::display_list::border; -use crate::display_list::gradient; -use crate::display_list::items::{self, BaseDisplayItem, ClipScrollNode}; -use crate::display_list::items::{ - ClipScrollNodeIndex, ClipScrollNodeType, ClipType, ClippingAndScrolling, -}; -use crate::display_list::items::{ClippingRegion, DisplayItem, DisplayItemMetadata, DisplayList}; -use crate::display_list::items::{CommonDisplayItem, DisplayListSection}; -use crate::display_list::items::{IframeDisplayItem, OpaqueNode}; -use crate::display_list::items::{PopAllTextShadowsDisplayItem, PushTextShadowDisplayItem}; -use crate::display_list::items::{StackingContext, StackingContextType, StickyFrameData}; -use crate::display_list::items::{TextOrientation, WebRenderImageInfo}; -use crate::display_list::ToLayout; -use crate::flow::{BaseFlow, Flow, FlowFlags}; -use crate::flow_ref::FlowRef; -use crate::fragment::SpecificFragmentInfo; -use crate::fragment::{CanvasFragmentSource, CoordinateSystem, Fragment, ScannedTextFragmentInfo}; -use crate::inline::InlineFragmentNodeFlags; -use crate::model::MaybeAuto; -use crate::table_cell::CollapsedBordersForCell; +use std::default::Default; +use std::sync::Arc; +use std::{f32, mem}; + use app_units::{Au, AU_PER_PX}; use bitflags::bitflags; use canvas_traits::canvas::{CanvasMsg, FromLayoutMsg}; use embedder_traits::Cursor; -use euclid::{ - default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D}, - rect, SideOffsets2D, -}; +use euclid::default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D}; +use euclid::{rect, SideOffsets2D}; use fnv::FnvHashMap; use gfx::text::glyph::ByteIndex; use gfx::text::TextRun; @@ -50,10 +29,6 @@ use net_traits::image_cache::UsePlaceholder; use range::Range; use servo_config::opts; use servo_geometry::{self, MaxRect}; -use std::default::Default; -use std::f32; -use std::mem; -use std::sync::Arc; use style::computed_values::border_style::T as BorderStyle; use style::computed_values::overflow_x::T as StyleOverflow; use style::computed_values::pointer_events::T as PointerEvents; @@ -77,6 +52,26 @@ use webrender_api::{ NinePatchBorderSource, NormalBorder, PropertyBinding, ScrollSensitivity, StickyOffsetBounds, }; +use crate::block::BlockFlow; +use crate::context::LayoutContext; +use crate::display_list::background::{self, get_cyclic}; +use crate::display_list::items::{ + self, BaseDisplayItem, ClipScrollNode, ClipScrollNodeIndex, ClipScrollNodeType, ClipType, + ClippingAndScrolling, ClippingRegion, CommonDisplayItem, DisplayItem, DisplayItemMetadata, + DisplayList, DisplayListSection, IframeDisplayItem, OpaqueNode, PopAllTextShadowsDisplayItem, + PushTextShadowDisplayItem, StackingContext, StackingContextType, StickyFrameData, + TextOrientation, WebRenderImageInfo, +}; +use crate::display_list::{border, gradient, ToLayout}; +use crate::flow::{BaseFlow, Flow, FlowFlags}; +use crate::flow_ref::FlowRef; +use crate::fragment::{ + CanvasFragmentSource, CoordinateSystem, Fragment, ScannedTextFragmentInfo, SpecificFragmentInfo, +}; +use crate::inline::InlineFragmentNodeFlags; +use crate::model::MaybeAuto; +use crate::table_cell::CollapsedBordersForCell; + static THREAD_TINT_COLORS: [ColorF; 8] = [ ColorF { r: 6.0 / 255.0, diff --git a/components/layout/display_list/gradient.rs b/components/layout/display_list/gradient.rs index 4ec54479972..4e732247795 100644 --- a/components/layout/display_list/gradient.rs +++ b/components/layout/display_list/gradient.rs @@ -2,7 +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 crate::display_list::ToLayout; use app_units::Au; use euclid::default::{Point2D, Size2D, Vector2D}; use style::properties::ComputedValues; @@ -11,6 +10,8 @@ use style::values::computed::{Angle, Color, LengthPercentage, Percentage, Positi use style::values::generics::image::{Circle, ColorStop, Ellipse, GradientItem, ShapeExtent}; use webrender_api::{ExtendMode, Gradient, GradientBuilder, GradientStop, RadialGradient}; +use crate::display_list::ToLayout; + /// A helper data structure for gradients. #[derive(Clone, Copy)] struct StopRun { diff --git a/components/layout/display_list/items.rs b/components/layout/display_list/items.rs index 4b892618fb0..58a90447849 100644 --- a/components/layout/display_list/items.rs +++ b/components/layout/display_list/items.rs @@ -12,6 +12,10 @@ //! They are therefore not exactly analogous to constructs like Skia pictures, which consist of //! low-level drawing primitives. +use std::cmp::Ordering; +use std::collections::HashMap; +use std::{f32, fmt}; + use embedder_traits::Cursor; use euclid::{SideOffsets2D, Vector2D}; use gfx_traits::print_tree::PrintTree; @@ -21,11 +25,8 @@ use net_traits::image::base::Image; use script_traits::compositor::ScrollTreeNodeId; use serde::Serialize; use servo_geometry::MaxRect; -use std::cmp::Ordering; -use std::collections::HashMap; -use std::f32; -use std::fmt; use style::computed_values::_servo_top_layer::T as InTopLayer; +pub use style::dom::OpaqueNode; use webrender_api as wr; use webrender_api::units::{LayoutPixel, LayoutRect, LayoutTransform}; use webrender_api::{ @@ -34,8 +35,6 @@ use webrender_api::{ PrimitiveFlags, ScrollSensitivity, Shadow, SpatialId, StickyOffsetBounds, TransformStyle, }; -pub use style::dom::OpaqueNode; - /// The factor that we multiply the blur radius by in order to inflate the boundaries of display /// items that involve a blur. This ensures that the display item boundaries include all the ink. pub static BLUR_INFLATION_FACTOR: i32 = 3; diff --git a/components/layout/display_list/mod.rs b/components/layout/display_list/mod.rs index 0ac0f81e7ee..57fffef5469 100644 --- a/components/layout/display_list/mod.rs +++ b/components/layout/display_list/mod.rs @@ -2,11 +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/. */ -pub use self::builder::BorderPaintingMode; -pub use self::builder::DisplayListBuildState; -pub use self::builder::IndexableText; -pub use self::builder::StackingContextCollectionFlags; -pub use self::builder::StackingContextCollectionState; +pub use self::builder::{ + BorderPaintingMode, DisplayListBuildState, IndexableText, StackingContextCollectionFlags, + StackingContextCollectionState, +}; pub use self::conversions::ToLayout; mod background; diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs index 31fbc4eb3d4..1e584c0c06f 100644 --- a/components/layout/display_list/webrender_helpers.rs +++ b/components/layout/display_list/webrender_helpers.rs @@ -7,8 +7,6 @@ // This might be achieved by sharing types between WR and Servo display lists, or // completely converting layout to directly generate WebRender display lists, for example. -use crate::display_list::items::{BaseDisplayItem, ClipScrollNode, ClipScrollNodeType, ClipType}; -use crate::display_list::items::{DisplayItem, DisplayList, StackingContextType}; use log::trace; use msg::constellation_msg::PipelineId; use script_traits::compositor::{CompositorDisplayListInfo, ScrollTreeNodeId, ScrollableNodeInfo}; @@ -19,6 +17,11 @@ use webrender_api::{ RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId, StackingContext, }; +use crate::display_list::items::{ + BaseDisplayItem, ClipScrollNode, ClipScrollNodeType, ClipType, DisplayItem, DisplayList, + StackingContextType, +}; + struct ClipScrollState<'a> { clip_scroll_nodes: &'a mut Vec<ClipScrollNode>, compositor_info: CompositorDisplayListInfo, |