mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting * Reformat all imports
This commit is contained in:
parent
413da4ca69
commit
aad2dccc9c
802 changed files with 6861 additions and 6395 deletions
|
@ -2,11 +2,12 @@
|
|||
* 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 std::fmt;
|
||||
use std::ops::Deref;
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
use serde::{Serialize, Serializer};
|
||||
use servo_arc::Arc;
|
||||
use std::fmt;
|
||||
use std::ops::Deref;
|
||||
|
||||
pub(crate) struct ArcRefCell<T> {
|
||||
value: Arc<AtomicRefCell<T>>,
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* 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::WebRenderImageInfo;
|
||||
use std::cell::RefCell;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use fnv::FnvHashMap;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx::font_context::FontContext;
|
||||
|
@ -13,11 +15,11 @@ use net_traits::image_cache::{
|
|||
use parking_lot::RwLock;
|
||||
use script_layout_interface::{PendingImage, PendingImageState};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use std::cell::RefCell;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::context::SharedStyleContext;
|
||||
use style::dom::OpaqueNode;
|
||||
|
||||
use crate::display_list::WebRenderImageInfo;
|
||||
|
||||
pub struct LayoutContext<'a> {
|
||||
pub id: PipelineId,
|
||||
pub use_rayon: bool,
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
* 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::replaced::IntrinsicSizes;
|
||||
use euclid::{Size2D, Vector2D};
|
||||
use style::computed_values::background_clip::single_value::T as Clip;
|
||||
use style::computed_values::background_origin::single_value::T as Origin;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::background::BackgroundSize as Size;
|
||||
use style::values::computed::{Length, LengthPercentage};
|
||||
use style::values::specified::background::BackgroundRepeat as RepeatXY;
|
||||
use style::values::specified::background::BackgroundRepeatKeyword as Repeat;
|
||||
use style::values::specified::background::{
|
||||
BackgroundRepeat as RepeatXY, BackgroundRepeatKeyword as Repeat,
|
||||
};
|
||||
use webrender_api::{self as wr, units};
|
||||
|
||||
use crate::replaced::IntrinsicSizes;
|
||||
|
||||
pub(super) struct BackgroundLayer {
|
||||
pub common: wr::CommonItemProperties,
|
||||
pub bounds: units::LayoutRect,
|
||||
|
|
|
@ -2,14 +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::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize};
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
|
||||
use style::computed_values::transform_style::T as ComputedTransformStyle;
|
||||
use style::values::computed::Filter as ComputedFilter;
|
||||
use style::values::computed::Length;
|
||||
use style::values::computed::{Filter as ComputedFilter, Length};
|
||||
use webrender_api::{units, FilterOp, LineStyle, MixBlendMode, TransformStyle};
|
||||
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize};
|
||||
|
||||
pub trait ToWebRender {
|
||||
type Type;
|
||||
fn to_webrender(&self) -> Self::Type;
|
||||
|
|
|
@ -2,13 +2,9 @@
|
|||
* 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::context::LayoutContext;
|
||||
use crate::display_list::conversions::ToWebRender;
|
||||
use crate::display_list::stacking_context::StackingContextSection;
|
||||
use crate::fragment_tree::{BoxFragment, Fragment, FragmentTree, Tag, TextFragment};
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect};
|
||||
use crate::replaced::IntrinsicSizes;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use std::cell::OnceCell;
|
||||
use std::sync::Arc;
|
||||
|
||||
use embedder_traits::Cursor;
|
||||
use euclid::{Point2D, SideOffsets2D, Size2D};
|
||||
use fnv::FnvHashMap;
|
||||
|
@ -16,8 +12,6 @@ use gfx::text::glyph::GlyphStore;
|
|||
use msg::constellation_msg::BrowsingContextId;
|
||||
use net_traits::image_cache::UsePlaceholder;
|
||||
use script_traits::compositor::{CompositorDisplayListInfo, ScrollTreeNodeId};
|
||||
use std::cell::OnceCell;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::longhands::visibility::computed_value::T as Visibility;
|
||||
|
@ -28,6 +22,14 @@ use style::values::specified::ui::CursorKind;
|
|||
use style_traits::CSSPixel;
|
||||
use webrender_api::{self as wr, units, ClipChainId, ClipId, CommonItemProperties};
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::conversions::ToWebRender;
|
||||
use crate::display_list::stacking_context::StackingContextSection;
|
||||
use crate::fragment_tree::{BoxFragment, Fragment, FragmentTree, Tag, TextFragment};
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect};
|
||||
use crate::replaced::IntrinsicSizes;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
|
||||
mod background;
|
||||
mod conversions;
|
||||
mod gradient;
|
||||
|
|
|
@ -2,6 +2,25 @@
|
|||
* 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 std::cmp::Ordering;
|
||||
use std::mem;
|
||||
|
||||
use euclid::default::Rect;
|
||||
use script_traits::compositor::{ScrollTreeNodeId, ScrollableNodeInfo};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::computed_values::float::T as ComputedFloat;
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::overflow_x::T as ComputedOverflow;
|
||||
use style::computed_values::position::T as ComputedPosition;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{ClipRectOrAuto, Length};
|
||||
use style::values::generics::box_::Perspective;
|
||||
use style::values::generics::transform;
|
||||
use style::values::specified::box_::DisplayOutside;
|
||||
use webrender_api as wr;
|
||||
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutTransform, LayoutVector2D};
|
||||
use webrender_api::ScrollSensitivity;
|
||||
|
||||
use super::DisplayList;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::display_list::conversions::ToWebRender;
|
||||
|
@ -11,24 +30,6 @@ use crate::fragment_tree::{
|
|||
};
|
||||
use crate::geom::PhysicalRect;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use euclid::default::Rect;
|
||||
use script_traits::compositor::{ScrollTreeNodeId, ScrollableNodeInfo};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::cmp::Ordering;
|
||||
use std::mem;
|
||||
use style::computed_values::float::T as ComputedFloat;
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::overflow_x::T as ComputedOverflow;
|
||||
use style::computed_values::position::T as ComputedPosition;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::ClipRectOrAuto;
|
||||
use style::values::computed::Length;
|
||||
use style::values::generics::box_::Perspective;
|
||||
use style::values::generics::transform;
|
||||
use style::values::specified::box_::DisplayOutside;
|
||||
use webrender_api as wr;
|
||||
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutTransform, LayoutVector2D};
|
||||
use webrender_api::ScrollSensitivity;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct ContainingBlock {
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
* 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 std::marker::PhantomData;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::Image as NetImage;
|
||||
use script_layout_interface::wrapper_traits::{LayoutDataTrait, LayoutNode, ThreadSafeLayoutNode};
|
||||
use script_layout_interface::{HTMLCanvasDataSource, StyleData};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom_traversal::WhichPseudoElement;
|
||||
|
@ -10,15 +21,6 @@ use crate::flow::inline::InlineLevelBox;
|
|||
use crate::flow::BlockLevelBox;
|
||||
use crate::geom::PhysicalSize;
|
||||
use crate::replaced::{CanvasInfo, CanvasSource};
|
||||
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::Image as NetImage;
|
||||
use script_layout_interface::wrapper_traits::{LayoutDataTrait, LayoutNode, ThreadSafeLayoutNode};
|
||||
use script_layout_interface::{HTMLCanvasDataSource, StyleData};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
/// The data that is stored in each DOM node that is used by layout.
|
||||
#[derive(Default)]
|
||||
|
|
|
@ -2,19 +2,20 @@
|
|||
* 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 std::borrow::Cow;
|
||||
|
||||
use html5ever::LocalName;
|
||||
use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::values::generics::counters::{Content, ContentItem};
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
|
||||
use crate::fragment_tree::{BaseFragmentInfo, FragmentFlags, Tag};
|
||||
use crate::replaced::ReplacedContent;
|
||||
use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside, DisplayOutside};
|
||||
use html5ever::LocalName;
|
||||
use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::borrow::Cow;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::values::generics::counters::Content;
|
||||
use style::values::generics::counters::ContentItem;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub(crate) enum WhichPseudoElement {
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
* 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 std::borrow::Cow;
|
||||
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
use super::{FlexContainer, FlexLevelBox};
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
|
@ -10,9 +15,6 @@ use crate::dom_traversal::{Contents, NodeAndStyleInfo, NonReplacedContents, Trav
|
|||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::style_ext::DisplayGeneratingBox;
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use std::borrow::Cow;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
impl FlexContainer {
|
||||
pub fn construct<'dom>(
|
||||
|
|
|
@ -4,9 +4,10 @@
|
|||
|
||||
//! https://drafts.csswg.org/css-flexbox/#box-model
|
||||
|
||||
use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
|
||||
use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(super) struct FlexRelativeVec2<T> {
|
||||
pub main: T,
|
||||
|
|
|
@ -2,6 +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 std::cell::Cell;
|
||||
|
||||
use atomic_refcell::AtomicRefMut;
|
||||
use style::properties::longhands::align_content::computed_value::T as AlignContent;
|
||||
use style::properties::longhands::align_items::computed_value::T as AlignItems;
|
||||
use style::properties::longhands::align_self::computed_value::T as AlignSelf;
|
||||
use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
use style::properties::longhands::flex_wrap::computed_value::T as FlexWrap;
|
||||
use style::properties::longhands::justify_content::computed_value::T as JustifyContent;
|
||||
use style::values::computed::length::Size;
|
||||
use style::values::computed::Length;
|
||||
use style::values::generics::flex::GenericFlexBasis as FlexBasis;
|
||||
use style::values::CSSFloat;
|
||||
use style::Zero;
|
||||
|
||||
use super::geom::{
|
||||
FlexAxis, FlexRelativeRect, FlexRelativeSides, FlexRelativeVec2, MainStartCrossStart,
|
||||
};
|
||||
|
@ -15,20 +31,6 @@ use crate::positioned::{AbsolutelyPositionedBox, PositioningContext, Positioning
|
|||
use crate::sizing::ContentSizes;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::ContainingBlock;
|
||||
use atomic_refcell::AtomicRefMut;
|
||||
use std::cell::Cell;
|
||||
use style::properties::longhands::align_content::computed_value::T as AlignContent;
|
||||
use style::properties::longhands::align_items::computed_value::T as AlignItems;
|
||||
use style::properties::longhands::align_self::computed_value::T as AlignSelf;
|
||||
use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
use style::properties::longhands::flex_wrap::computed_value::T as FlexWrap;
|
||||
use style::properties::longhands::justify_content::computed_value::T as JustifyContent;
|
||||
use style::values::computed::length::Size;
|
||||
use style::values::computed::Length;
|
||||
use style::values::generics::flex::GenericFlexBasis as FlexBasis;
|
||||
use style::values::CSSFloat;
|
||||
use style::Zero;
|
||||
|
||||
// FIMXE: “Flex items […] `z-index` values other than `auto` create a stacking context
|
||||
// even if `position` is `static` (behaving exactly as if `position` were `relative`).”
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
* 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 std::borrow::Cow;
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::white_space::T as WhiteSpace;
|
||||
use style::properties::longhands::list_style_position::computed_value::T as ListStylePosition;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
|
||||
|
@ -12,15 +23,6 @@ use crate::flow::{BlockContainer, BlockFormattingContext, BlockLevelBox};
|
|||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::style_ext::{ComputedValuesExt, DisplayGeneratingBox, DisplayInside, DisplayOutside};
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use std::borrow::Cow;
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use style::computed_values::white_space::T as WhiteSpace;
|
||||
use style::properties::longhands::list_style_position::computed_value::T as ListStylePosition;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
impl BlockFormattingContext {
|
||||
pub fn construct<'dom, Node>(
|
||||
|
|
|
@ -6,6 +6,19 @@
|
|||
//!
|
||||
//! See CSS 2.1 § 9.5.1: https://www.w3.org/TR/CSS2/visuren.html#float-position
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt::{Debug, Formatter, Result as FmtResult};
|
||||
use std::ops::Range;
|
||||
use std::{f32, mem};
|
||||
|
||||
use euclid::num::Zero;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::float::T as FloatProperty;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{CSSPixelLength, Clear, Length};
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::{Contents, NodeAndStyleInfo};
|
||||
|
@ -15,17 +28,6 @@ use crate::geom::flow_relative::{Rect, Vec2};
|
|||
use crate::positioned::PositioningContext;
|
||||
use crate::style_ext::{ComputedValuesExt, DisplayInside, PaddingBorderMargin};
|
||||
use crate::ContainingBlock;
|
||||
use euclid::num::Zero;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt::{Debug, Formatter, Result as FmtResult};
|
||||
use std::ops::Range;
|
||||
use std::{f32, mem};
|
||||
use style::computed_values::float::T as FloatProperty;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{CSSPixelLength, Clear, Length};
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
/// A floating box.
|
||||
#[derive(Debug, Serialize)]
|
||||
|
|
|
@ -2,6 +2,24 @@
|
|||
* 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 std::cell::OnceCell;
|
||||
|
||||
use app_units::Au;
|
||||
use atomic_refcell::AtomicRef;
|
||||
use gfx::text::glyph::GlyphStore;
|
||||
use gfx::text::text_run::GlyphRun;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::white_space::T as WhiteSpace;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::values::generics::text::LineHeight;
|
||||
use style::values::specified::text::{TextAlignKeyword, TextDecorationLine};
|
||||
use style::Zero;
|
||||
use webrender_api::FontInstanceKey;
|
||||
use xi_unicode::LineBreakLeafIter;
|
||||
|
||||
use super::float::PlacementAmongFloats;
|
||||
use super::CollapsibleWithParentStartMargin;
|
||||
use crate::cell::ArcRefCell;
|
||||
|
@ -23,23 +41,6 @@ use crate::style_ext::{
|
|||
ComputedValuesExt, Display, DisplayGeneratingBox, DisplayOutside, PaddingBorderMargin,
|
||||
};
|
||||
use crate::ContainingBlock;
|
||||
use app_units::Au;
|
||||
use atomic_refcell::AtomicRef;
|
||||
use gfx::text::glyph::GlyphStore;
|
||||
use gfx::text::text_run::GlyphRun;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use std::cell::OnceCell;
|
||||
use style::computed_values::white_space::T as WhiteSpace;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::values::generics::text::LineHeight;
|
||||
use style::values::specified::text::TextAlignKeyword;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
use webrender_api::FontInstanceKey;
|
||||
use xi_unicode::LineBreakLeafIter;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct InlineFormattingContext {
|
||||
|
|
|
@ -4,6 +4,16 @@
|
|||
|
||||
//! Flow layout, also known as block-and-inline layout.
|
||||
|
||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::clear::T as Clear;
|
||||
use style::computed_values::float::T as Float;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style::Zero;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::flow::float::{
|
||||
|
@ -22,15 +32,6 @@ use crate::replaced::ReplacedContent;
|
|||
use crate::sizing::{self, ContentSizes};
|
||||
use crate::style_ext::{ComputedValuesExt, PaddingBorderMargin};
|
||||
use crate::ContainingBlock;
|
||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::clear::T as Clear;
|
||||
use style::computed_values::float::T as Float;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style::Zero;
|
||||
|
||||
mod construct;
|
||||
pub mod float;
|
||||
|
|
|
@ -2,6 +2,16 @@
|
|||
* 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 atomic_refcell::AtomicRef;
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{LayoutBox, NodeExt};
|
||||
|
@ -14,21 +24,10 @@ use crate::formatting_contexts::IndependentFormattingContext;
|
|||
use crate::fragment_tree::FragmentTree;
|
||||
use crate::geom::flow_relative::Vec2;
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSize};
|
||||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::positioned::PositioningContext;
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
|
||||
use crate::replaced::ReplacedContent;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside};
|
||||
use crate::style_ext::{ComputedValuesExt, Display, DisplayGeneratingBox, DisplayInside};
|
||||
use crate::DefiniteContainingBlock;
|
||||
use atomic_refcell::AtomicRef;
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct BoxTree {
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
* 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 std::convert::TryInto;
|
||||
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::{Contents, NodeAndStyleInfo};
|
||||
|
@ -13,13 +22,6 @@ use crate::replaced::ReplacedContent;
|
|||
use crate::sizing::{self, ContentSizes};
|
||||
use crate::style_ext::DisplayInside;
|
||||
use crate::ContainingBlock;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc;
|
||||
use std::convert::TryInto;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
||||
/// https://drafts.csswg.org/css-display/#independent-formatting-context
|
||||
#[derive(Debug, Serialize)]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -2,16 +2,19 @@
|
|||
* 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::ContainingBlock;
|
||||
use std::fmt;
|
||||
use std::ops::{Add, AddAssign, Sub};
|
||||
use style::logical_geometry::{BlockFlowDirection, InlineBaseDirection};
|
||||
use style::logical_geometry::{PhysicalCorner, WritingMode};
|
||||
|
||||
use style::logical_geometry::{
|
||||
BlockFlowDirection, InlineBaseDirection, PhysicalCorner, WritingMode,
|
||||
};
|
||||
use style::values::computed::{Length, LengthPercentage};
|
||||
use style::values::generics::length::GenericLengthPercentageOrAuto as AutoOr;
|
||||
use style::Zero;
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
use crate::ContainingBlock;
|
||||
|
||||
pub type PhysicalPoint<U> = euclid::Point2D<U, CSSPixel>;
|
||||
pub type PhysicalSize<U> = euclid::Size2D<U, CSSPixel>;
|
||||
pub type PhysicalRect<U> = euclid::Rect<U, CSSPixel>;
|
||||
|
|
|
@ -5,18 +5,20 @@
|
|||
//! Supports writing a trace file created during each layout scope
|
||||
//! that can be viewed by an external tool to make layout debugging easier.
|
||||
|
||||
use crate::flow::BoxTree;
|
||||
use crate::fragment_tree::FragmentTree;
|
||||
#[cfg(not(debug_assertions))]
|
||||
use serde::ser::Serializer;
|
||||
use serde::Serialize;
|
||||
use serde_json::{to_string, to_value, Value};
|
||||
use std::cell::RefCell;
|
||||
use std::fs;
|
||||
#[cfg(debug_assertions)]
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
use serde::ser::Serializer;
|
||||
use serde::Serialize;
|
||||
use serde_json::{to_string, to_value, Value};
|
||||
|
||||
use crate::flow::BoxTree;
|
||||
use crate::fragment_tree::FragmentTree;
|
||||
|
||||
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
|
|
@ -27,11 +27,11 @@ pub mod traversal;
|
|||
|
||||
pub use flow::BoxTree;
|
||||
pub use fragment_tree::FragmentTree;
|
||||
|
||||
use crate::geom::flow_relative::Vec2;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
|
||||
use crate::geom::flow_relative::Vec2;
|
||||
|
||||
pub struct ContainingBlock<'a> {
|
||||
inline_size: Length,
|
||||
block_size: LengthOrAuto,
|
||||
|
|
|
@ -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 style::properties::longhands::list_style_type::computed_value::T as ListStyleType;
|
||||
use style::properties::style_structs;
|
||||
use style::values::computed::Image;
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::{NodeAndStyleInfo, PseudoElementContentItem};
|
||||
use crate::replaced::ReplacedContent;
|
||||
use style::properties::longhands::list_style_type::computed_value::T as ListStyleType;
|
||||
use style::properties::style_structs;
|
||||
use style::values::computed::Image;
|
||||
|
||||
/// https://drafts.csswg.org/css-lists/#content-property
|
||||
pub(crate) fn make_marker<'dom, Node>(
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
* 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 rayon::iter::IntoParallelRefMutIterator;
|
||||
use rayon::prelude::{IndexedParallelIterator, ParallelIterator};
|
||||
use serde::Serialize;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{CSSPixelLength, Length};
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
|
@ -14,14 +23,6 @@ use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
|||
use crate::geom::{LengthOrAuto, LengthPercentageOrAuto};
|
||||
use crate::style_ext::{ComputedValuesExt, DisplayInside};
|
||||
use crate::{ContainingBlock, DefiniteContainingBlock};
|
||||
use rayon::iter::IntoParallelRefMutIterator;
|
||||
use rayon::prelude::{IndexedParallelIterator, ParallelIterator};
|
||||
use serde::Serialize;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{CSSPixelLength, Length};
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct AbsolutelyPositionedBox {
|
||||
|
|
|
@ -3,40 +3,39 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! Utilities for querying the layout, as needed by the layout thread.
|
||||
use crate::context::LayoutContext;
|
||||
use crate::fragment_tree::{Fragment, FragmentFlags, FragmentTree, Tag};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use app_units::Au;
|
||||
use euclid::default::{Point2D, Rect};
|
||||
use euclid::Size2D;
|
||||
use euclid::Vector2D;
|
||||
use euclid::{Size2D, Vector2D};
|
||||
use log::warn;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use script_layout_interface::rpc::TextIndexResponse;
|
||||
use script_layout_interface::rpc::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC};
|
||||
use script_layout_interface::rpc::{NodeGeometryResponse, NodeScrollIdResponse};
|
||||
use script_layout_interface::rpc::{OffsetParentResponse, ResolvedStyleResponse};
|
||||
use script_layout_interface::rpc::{
|
||||
ContentBoxResponse, ContentBoxesResponse, LayoutRPC, NodeGeometryResponse,
|
||||
NodeScrollIdResponse, OffsetParentResponse, ResolvedStyleResponse, TextIndexResponse,
|
||||
};
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::context::{StyleContext, ThreadLocalStyleContext};
|
||||
use style::dom::OpaqueNode;
|
||||
use style::dom::TElement;
|
||||
use style::dom::{OpaqueNode, TElement};
|
||||
use style::properties::style_structs::Font;
|
||||
use style::properties::{LonghandId, PropertyDeclarationId, PropertyId};
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::stylist::RuleInclusion;
|
||||
use style::traversal::resolve_style;
|
||||
use style::values::generics::text::LineHeight;
|
||||
use style_traits::CSSPixel;
|
||||
use style_traits::ToCss;
|
||||
use style_traits::{CSSPixel, ToCss};
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::{DisplayListBuilder, ExternalScrollId};
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::fragment_tree::{Fragment, FragmentFlags, FragmentTree, Tag};
|
||||
|
||||
/// Mutable data belonging to the LayoutThread.
|
||||
///
|
||||
/// This needs to be protected by a mutex so we can do fast RPCs.
|
||||
|
|
|
@ -2,6 +2,24 @@
|
|||
* 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 std::fmt;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromLayoutMsg};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::Image;
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
use style::servo::url::ComputedUrl;
|
||||
use style::values::computed::image::Image as ComputedImage;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style::values::CSSFloat;
|
||||
use style::Zero;
|
||||
use webrender_api::ImageKey;
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::fragment_tree::{BaseFragmentInfo, Fragment, IFrameFragment, ImageFragment};
|
||||
|
@ -10,22 +28,6 @@ use crate::geom::PhysicalSize;
|
|||
use crate::sizing::ContentSizes;
|
||||
use crate::style_ext::{ComputedValuesExt, PaddingBorderMargin};
|
||||
use crate::ContainingBlock;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromLayoutMsg};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::Image;
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use std::fmt;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::properties::ComputedValues;
|
||||
use style::servo::url::ComputedUrl;
|
||||
use style::values::computed::image::Image as ComputedImage;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style::values::CSSFloat;
|
||||
use style::Zero;
|
||||
use webrender_api::ImageKey;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct ReplacedContent {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
//! https://drafts.csswg.org/css-sizing/
|
||||
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use serde::Serialize;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
|
||||
|
@ -12,6 +11,8 @@ use style::properties::ComputedValues;
|
|||
use style::values::computed::Length;
|
||||
use style::Zero;
|
||||
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub(crate) struct ContentSizes {
|
||||
pub min_content: Length,
|
||||
|
|
|
@ -2,9 +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::geom::flow_relative;
|
||||
use crate::geom::{LengthOrAuto, LengthPercentageOrAuto, PhysicalSides, PhysicalSize};
|
||||
use crate::ContainingBlock;
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::position::T as ComputedPosition;
|
||||
use style::computed_values::transform_style::T as ComputedTransformStyle;
|
||||
|
@ -14,14 +11,18 @@ use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
|
|||
use style::properties::longhands::column_span::computed_value::T as ColumnSpan;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::image::Image as ComputedImageLayer;
|
||||
use style::values::computed::{Length, LengthPercentage};
|
||||
use style::values::computed::{NonNegativeLengthPercentage, Size};
|
||||
use style::values::computed::{Length, LengthPercentage, NonNegativeLengthPercentage, Size};
|
||||
use style::values::generics::box_::Perspective;
|
||||
use style::values::generics::length::MaxSize;
|
||||
use style::values::specified::box_ as stylo;
|
||||
use style::Zero;
|
||||
use webrender_api as wr;
|
||||
|
||||
use crate::geom::{
|
||||
flow_relative, LengthOrAuto, LengthPercentageOrAuto, PhysicalSides, PhysicalSize,
|
||||
};
|
||||
use crate::ContainingBlock;
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
pub(crate) enum Display {
|
||||
None,
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
|
||||
//! Property-based randomized testing for the core float layout algorithm.
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
use euclid::num::Zero;
|
||||
use layout_2020::flow::float::{ContainingBlockPositionInfo, FloatSide, PlacementInfo};
|
||||
use layout_2020::flow::float::{FloatBand, FloatBandNode, FloatBandTree, FloatContext};
|
||||
use layout_2020::geom::flow_relative::{Rect, Vec2};
|
||||
use quickcheck::{Arbitrary, Gen};
|
||||
use std::f32;
|
||||
use std::ops::Range;
|
||||
use std::panic::{self, PanicInfo};
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
use std::thread;
|
||||
use std::u32;
|
||||
use std::{f32, thread, u32};
|
||||
|
||||
use euclid::num::Zero;
|
||||
use layout_2020::flow::float::{
|
||||
ContainingBlockPositionInfo, FloatBand, FloatBandNode, FloatBandTree, FloatContext, FloatSide,
|
||||
PlacementInfo,
|
||||
};
|
||||
use layout_2020::geom::flow_relative::{Rect, Vec2};
|
||||
use lazy_static::lazy_static;
|
||||
use quickcheck::{Arbitrary, Gen};
|
||||
use style::values::computed::{Clear, Length};
|
||||
|
||||
lazy_static! {
|
||||
|
|
|
@ -2,14 +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::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use style::context::{SharedStyleContext, StyleContext};
|
||||
use style::data::ElementData;
|
||||
use style::dom::{NodeInfo, TElement, TNode};
|
||||
use style::traversal::PerLevelTraversalData;
|
||||
use style::traversal::{recalc_style_at, DomTraversal};
|
||||
use style::traversal::{recalc_style_at, DomTraversal, PerLevelTraversalData};
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
|
||||
pub struct RecalcStyle<'a> {
|
||||
context: LayoutContext<'a>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue