mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
Move util::logical_geometry to style
This commit is contained in:
parent
63dc161b77
commit
db8d502f41
27 changed files with 32 additions and 34 deletions
|
@ -59,11 +59,11 @@ use std::sync::Arc;
|
|||
use style::computed_values::{border_collapse, box_sizing, display, float, overflow_x, overflow_y};
|
||||
use style::computed_values::{position, text_align, transform_style};
|
||||
use style::context::StyleContext;
|
||||
use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use util::geometry::MAX_RECT;
|
||||
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||
use util::opts;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ use style::computed_values::{background_attachment, background_clip, background_
|
|||
use style::computed_values::{background_repeat, background_size};
|
||||
use style::computed_values::{border_style, image_rendering, overflow_x, position};
|
||||
use style::computed_values::{transform, transform_style, visibility};
|
||||
use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::style_structs::Border;
|
||||
use style::properties::{self, ComputedValues};
|
||||
use style::values::RGBA;
|
||||
|
@ -56,7 +57,6 @@ use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirec
|
|||
use style_traits::cursor::Cursor;
|
||||
use table_cell::CollapsedBordersForCell;
|
||||
use url::Url;
|
||||
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||
use util::opts;
|
||||
use util::range::Range;
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ use model::{IntrinsicISizes};
|
|||
use std::cmp::max;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{flex_direction, float};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::opts;
|
||||
|
||||
// A mode describes which logical axis a flex axis is parallel with.
|
||||
|
|
|
@ -7,8 +7,7 @@ use std::cmp::{max, min};
|
|||
use std::fmt;
|
||||
use std::i32;
|
||||
use style::computed_values::float;
|
||||
use util::logical_geometry::WritingMode;
|
||||
use util::logical_geometry::{LogicalRect, LogicalSize};
|
||||
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||
use util::persistent_list::PersistentList;
|
||||
|
||||
/// The kind of float: left or right.
|
||||
|
|
|
@ -48,6 +48,7 @@ use std::sync::atomic::Ordering;
|
|||
use std::{fmt, mem, raw};
|
||||
use style::computed_values::{clear, display, empty_cells, float, position, text_align};
|
||||
use style::dom::TRestyleDamage;
|
||||
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::{self, ComputedValues};
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
|
||||
|
@ -57,7 +58,6 @@ use table_colgroup::TableColGroupFlow;
|
|||
use table_row::TableRowFlow;
|
||||
use table_rowgroup::TableRowGroupFlow;
|
||||
use table_wrapper::TableWrapperFlow;
|
||||
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||
use util::print_tree::PrintTree;
|
||||
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ use style::computed_values::{border_collapse, clear, display, mix_blend_mode, ov
|
|||
use style::computed_values::{overflow_x, position, text_decoration, transform_style};
|
||||
use style::computed_values::{white_space, word_break, z_index};
|
||||
use style::dom::TRestyleDamage;
|
||||
use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{LengthOrPercentageOrNone};
|
||||
|
@ -47,7 +48,6 @@ use text;
|
|||
use text::TextRunScanner;
|
||||
use url::Url;
|
||||
use util;
|
||||
use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||
use util::range::*;
|
||||
use util::str::slice_chars;
|
||||
use wrapper::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
|
|
|
@ -27,12 +27,12 @@ use std::sync::Arc;
|
|||
use std::{fmt, isize, mem};
|
||||
use style::computed_values::{display, overflow_x, position, text_align, text_justify};
|
||||
use style::computed_values::{text_overflow, vertical_align, white_space};
|
||||
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentage;
|
||||
use text;
|
||||
use unicode_bidi;
|
||||
use util;
|
||||
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||
use util::print_tree::PrintTree;
|
||||
use util::range::{Range, RangeIndex};
|
||||
use wrapper::PseudoElementType;
|
||||
|
|
|
@ -65,6 +65,7 @@ use style::computed_values::{filter, mix_blend_mode};
|
|||
use style::context::{ReflowGoal, StylistWrapper};
|
||||
use style::dom::{TDocument, TElement, TNode};
|
||||
use style::error_reporting::ParseErrorReporter;
|
||||
use style::logical_geometry::LogicalPoint;
|
||||
use style::media_queries::{Device, MediaType};
|
||||
use style::parallel::WorkQueueData;
|
||||
use style::selector_impl::ServoSelectorImpl;
|
||||
|
@ -75,7 +76,6 @@ use traversal::RecalcStyleAndConstructFlows;
|
|||
use url::Url;
|
||||
use util::geometry::MAX_RECT;
|
||||
use util::ipc::OptionalIpcSender;
|
||||
use util::logical_geometry::LogicalPoint;
|
||||
use util::opts;
|
||||
use util::thread;
|
||||
use util::thread_state;
|
||||
|
|
|
@ -22,9 +22,9 @@ use incremental::RESOLVE_GENERATED_CONTENT;
|
|||
use inline::InlineMetrics;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{list_style_type, position};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use text;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::opts;
|
||||
|
||||
/// A block with the CSS `display` property equal to `list-item`.
|
||||
|
|
|
@ -12,10 +12,10 @@ use fragment::Fragment;
|
|||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::computed_values::transform::ComputedMatrix;
|
||||
use style::logical_geometry::LogicalMargin;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
|
||||
use util::logical_geometry::LogicalMargin;
|
||||
|
||||
/// A collapsible margin. See CSS 2.1 § 8.3.1.
|
||||
#[derive(Copy, Clone)]
|
||||
|
|
|
@ -18,9 +18,9 @@ use std::cmp::{min, max};
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::context::StyleContext;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
pub struct MulticolFlow {
|
||||
|
|
|
@ -24,12 +24,12 @@ use std::ops::Deref;
|
|||
use std::sync::{Arc, Mutex};
|
||||
use string_cache::Atom;
|
||||
use style::computed_values;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::longhands::{display, position};
|
||||
use style::properties::style_structs;
|
||||
use style::selector_impl::PseudoElement;
|
||||
use style::values::AuExtensionMethods;
|
||||
use style_traits::cursor::Cursor;
|
||||
use util::logical_geometry::WritingMode;
|
||||
use wrapper::{LayoutNode, ThreadSafeLayoutNode};
|
||||
|
||||
pub struct LayoutRPCImpl(pub Arc<Mutex<LayoutThreadData>>);
|
||||
|
|
|
@ -23,13 +23,13 @@ use std::cmp;
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, border_spacing, table_layout};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table_row::{TableRowFlow};
|
||||
use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
|
||||
use table_wrapper::TableLayout;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
/// A table flow corresponded to the table's internal table fragment under a table wrapper flow.
|
||||
|
|
|
@ -14,8 +14,8 @@ use flow::{Flow, FlowClass, OpaqueFlow};
|
|||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -20,10 +20,10 @@ use model::MaybeAuto;
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, border_top_style};
|
||||
use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use table::InternalTable;
|
||||
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
|
||||
use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||
use util::print_tree::PrintTree;
|
||||
use wrapper::{ThreadSafeLayoutNode};
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ use layout_debug;
|
|||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
|
||||
/// A table formatting context.
|
||||
pub struct TableColGroupFlow {
|
||||
|
|
|
@ -24,11 +24,11 @@ use std::fmt;
|
|||
use std::iter::{Enumerate, IntoIterator, Peekable};
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, border_spacing, border_top_style};
|
||||
use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
|
||||
use table_cell::{CollapsedBordersForCell, TableCellFlow};
|
||||
use util::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
/// A single row of a table.
|
||||
|
|
|
@ -18,10 +18,10 @@ use std::fmt;
|
|||
use std::iter::{IntoIterator, Iterator, Peekable};
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, border_spacing};
|
||||
use style::logical_geometry::{LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
|
||||
use table_row::{self, CollapsedBordersForRow};
|
||||
use util::logical_geometry::{LogicalSize, WritingMode};
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -28,12 +28,12 @@ use std::fmt;
|
|||
use std::ops::Add;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, table_layout};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
|
||||
use table_row;
|
||||
use util::logical_geometry::LogicalSize;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
#[derive(Copy, Clone, RustcEncodable, Debug)]
|
||||
|
|
|
@ -21,12 +21,12 @@ use std::mem;
|
|||
use std::sync::Arc;
|
||||
use style::computed_values::{line_height, text_orientation, text_rendering, text_transform};
|
||||
use style::computed_values::{white_space};
|
||||
use style::logical_geometry::{LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs::Font as FontStyle;
|
||||
use unicode_bidi::{is_rtl, process_text};
|
||||
use unicode_script::{get_script, Script};
|
||||
use util::linked_list::split_off_head;
|
||||
use util::logical_geometry::{LogicalSize, WritingMode};
|
||||
use util::range::{Range, RangeIndex};
|
||||
|
||||
/// Returns the concatenated text of a list of unscanned text fragments.
|
||||
|
|
|
@ -55,6 +55,7 @@ pub mod dom;
|
|||
pub mod element_state;
|
||||
pub mod error_reporting;
|
||||
pub mod font_face;
|
||||
pub mod logical_geometry;
|
||||
pub mod matching;
|
||||
pub mod media_queries;
|
||||
pub mod parallel;
|
||||
|
|
|
@ -22,12 +22,12 @@ use cssparser::{Parser, Color, RGBA, AtRuleParser, DeclarationParser, Delimiter,
|
|||
DeclarationListParser, parse_important, ToCss, TokenSerializationType};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use url::Url;
|
||||
use util::logical_geometry::{LogicalMargin, PhysicalSide, WritingMode};
|
||||
use euclid::SideOffsets2D;
|
||||
use euclid::size::Size2D;
|
||||
use fnv::FnvHasher;
|
||||
use string_cache::Atom;
|
||||
use computed_values;
|
||||
use logical_geometry::{LogicalMargin, PhysicalSide, WritingMode};
|
||||
use parser::{ParserContext, log_css_error};
|
||||
use selectors::matching::DeclarationBlock;
|
||||
use stylesheets::Origin;
|
||||
|
@ -6365,7 +6365,7 @@ impl ComputedValues {
|
|||
|
||||
/// Return a WritingMode bitflags from the relevant CSS properties.
|
||||
pub fn get_writing_mode(inheritedbox_style: &style_structs::InheritedBox) -> WritingMode {
|
||||
use util::logical_geometry;
|
||||
use logical_geometry;
|
||||
let mut flags = WritingMode::empty();
|
||||
match inheritedbox_style.direction {
|
||||
computed_values::direction::T::ltr => {},
|
||||
|
|
|
@ -55,7 +55,6 @@ pub mod deque;
|
|||
pub mod geometry;
|
||||
pub mod ipc;
|
||||
pub mod linked_list;
|
||||
pub mod logical_geometry;
|
||||
#[cfg(feature = "non-geckolib")]
|
||||
pub mod non_geckolib;
|
||||
pub mod opts;
|
||||
|
|
|
@ -17,15 +17,15 @@ extern crate style_traits;
|
|||
extern crate url;
|
||||
extern crate util;
|
||||
|
||||
|
||||
#[cfg(test)] mod stylesheets;
|
||||
#[cfg(test)] mod media_queries;
|
||||
#[cfg(test)] mod viewport;
|
||||
#[cfg(test)] mod attr;
|
||||
#[cfg(test)] mod logical_geometry;
|
||||
#[cfg(test)] mod media_queries;
|
||||
#[cfg(test)] mod stylesheets;
|
||||
#[cfg(test)] mod viewport;
|
||||
|
||||
#[cfg(test)] mod writing_modes {
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::{INITIAL_VALUES, get_writing_mode};
|
||||
use util::logical_geometry::WritingMode;
|
||||
|
||||
#[test]
|
||||
fn initial_writing_mode_is_empty() {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use euclid::{Size2D, Point2D, SideOffsets2D, Rect};
|
||||
use util::logical_geometry::{FLAG_RTL, FLAG_VERTICAL, FLAG_VERTICAL_LR, FLAG_SIDEWAYS_LEFT};
|
||||
use util::logical_geometry::{WritingMode, LogicalSize, LogicalPoint, LogicalMargin, LogicalRect};
|
||||
use style::logical_geometry::{FLAG_RTL, FLAG_VERTICAL, FLAG_VERTICAL_LR, FLAG_SIDEWAYS_LEFT};
|
||||
use style::logical_geometry::{WritingMode, LogicalSize, LogicalPoint, LogicalMargin, LogicalRect};
|
||||
|
||||
#[cfg(test)]
|
||||
fn modes() -> [WritingMode; 10] {
|
|
@ -13,8 +13,7 @@ extern crate libc;
|
|||
extern crate util;
|
||||
|
||||
#[cfg(test)] mod cache;
|
||||
#[cfg(test)] mod logical_geometry;
|
||||
#[cfg(test)] mod opts;
|
||||
#[cfg(test)] mod str;
|
||||
#[cfg(test)] mod thread;
|
||||
#[cfg(test)] mod vec;
|
||||
#[cfg(test)] mod str;
|
||||
#[cfg(test)] mod opts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue