mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
End the libstyle 'pub use' madness.
This commit is contained in:
parent
493a9e6a89
commit
d13d36f57f
39 changed files with 159 additions and 169 deletions
|
@ -57,10 +57,9 @@ use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
|
|||
use servo_util::opts;
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::ComputedValues;
|
||||
use style::computed_values::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use style::computed_values::{LengthOrPercentage, box_sizing, display, float};
|
||||
use style::computed_values::{overflow, position};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use style::computed_values::{overflow, position, box_sizing, display, float};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Information specific to floated blocks.
|
||||
|
|
|
@ -56,7 +56,7 @@ use std::mem;
|
|||
use std::sync::atomic::Ordering;
|
||||
use style::computed_values::{caption_side, display, empty_cells, float, list_style_position};
|
||||
use style::computed_values::{position};
|
||||
use style::{self, ComputedValues};
|
||||
use style::properties::{ComputedValues, make_inline};
|
||||
use std::sync::Arc;
|
||||
use url::Url;
|
||||
|
||||
|
@ -707,7 +707,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
// `baz` had better not be absolutely positioned!
|
||||
let mut style = (*node.style()).clone();
|
||||
if style.get_box().display != display::T::inline {
|
||||
style = Arc::new(style::make_inline(&*style))
|
||||
style = Arc::new(make_inline(&*style))
|
||||
}
|
||||
|
||||
// If this is generated content, then we need to initialize the accumulator with the
|
||||
|
|
|
@ -19,7 +19,7 @@ use std::cell::Cell;
|
|||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::Stylist;
|
||||
use style::selector_matching::Stylist;
|
||||
use url::Url;
|
||||
|
||||
struct LocalLayoutContext {
|
||||
|
|
|
@ -19,8 +19,12 @@ use std::mem;
|
|||
use std::hash::{Hash, Hasher, Writer};
|
||||
use std::slice::Iter;
|
||||
use string_cache::{Atom, Namespace};
|
||||
use style::{self, PseudoElement, ComputedValues, DeclarationBlock, Stylist, TElement, TNode};
|
||||
use style::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes, cascade};
|
||||
use style::selectors::PseudoElement;
|
||||
use style::selector_matching::{Stylist, DeclarationBlock};
|
||||
use style::node::{TElement, TNode};
|
||||
use style::properties::{ComputedValues, cascade};
|
||||
use style::selector_matching::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes};
|
||||
use style::selector_matching::{common_style_affecting_attributes, rare_style_affecting_attributes};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct ApplicableDeclarations {
|
||||
|
@ -156,7 +160,7 @@ pub struct StyleSharingCandidateCache {
|
|||
fn create_common_style_affecting_attributes_from_element(element: &LayoutElement)
|
||||
-> CommonStyleAffectingAttributes {
|
||||
let mut flags = CommonStyleAffectingAttributes::empty();
|
||||
for attribute_info in style::common_style_affecting_attributes().iter() {
|
||||
for attribute_info in common_style_affecting_attributes().iter() {
|
||||
match attribute_info.mode {
|
||||
CommonStyleAffectingAttributeMode::IsPresent(flag) => {
|
||||
if element.get_attr(&ns!(""), &attribute_info.atom).is_some() {
|
||||
|
@ -276,7 +280,7 @@ impl StyleSharingCandidate {
|
|||
// FIXME(pcwalton): It's probably faster to iterate over all the element's attributes and
|
||||
// use the {common, rare}-style-affecting-attributes tables as lookup tables.
|
||||
|
||||
for attribute_info in style::common_style_affecting_attributes().iter() {
|
||||
for attribute_info in common_style_affecting_attributes().iter() {
|
||||
match attribute_info.mode {
|
||||
CommonStyleAffectingAttributeMode::IsPresent(flag) => {
|
||||
if self.common_style_affecting_attributes.contains(flag) !=
|
||||
|
@ -303,7 +307,7 @@ impl StyleSharingCandidate {
|
|||
}
|
||||
}
|
||||
|
||||
for attribute_name in style::rare_style_affecting_attributes().iter() {
|
||||
for attribute_name in rare_style_affecting_attributes().iter() {
|
||||
if element.get_attr(&ns!(""), attribute_name).is_some() {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
|
||||
|
||||
use std::mem;
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Node mixin providing `style` method that returns a `NodeStyle`
|
||||
|
|
|
@ -47,12 +47,13 @@ use std::default::Default;
|
|||
use std::iter::repeat;
|
||||
use std::num::Float;
|
||||
use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
|
||||
use style::computed::{Image, LinearGradient, LengthOrPercentage};
|
||||
use style::values::computed::{Image, LinearGradient, LengthOrPercentage};
|
||||
use style::values::RGBA;
|
||||
use style::computed_values::filter::Filter;
|
||||
use style::computed_values::{background_attachment, background_repeat, border_style, overflow};
|
||||
use style::computed_values::{position, visibility};
|
||||
use style::style_structs::Border;
|
||||
use style::{ComputedValues, RGBA};
|
||||
use style::properties::style_structs::Border;
|
||||
use style::properties::ComputedValues;
|
||||
use std::num::ToPrimitive;
|
||||
use std::sync::Arc;
|
||||
use std::sync::mpsc::channel;
|
||||
|
|
|
@ -60,7 +60,7 @@ use std::raw;
|
|||
use std::sync::atomic::{AtomicUint, Ordering};
|
||||
use std::slice::IterMut;
|
||||
use style::computed_values::{clear, empty_cells, float, position, text_align};
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Virtual methods that make up a float context.
|
||||
|
|
|
@ -46,9 +46,10 @@ use std::str::FromStr;
|
|||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::mpsc::Sender;
|
||||
use string_cache::Atom;
|
||||
use style::{ComputedValues, TElement, TNode, cascade_anonymous};
|
||||
use style::computed_values::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use style::computed_values::{LengthOrPercentageOrNone, clear, mix_blend_mode, overflow_wrap};
|
||||
use style::properties::{ComputedValues, cascade_anonymous};
|
||||
use style::node::{TElement, TNode};
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use style::computed_values::{clear, mix_blend_mode, overflow_wrap};
|
||||
use style::computed_values::{position, text_align, text_decoration, vertical_align, white_space};
|
||||
use style::computed_values::{word_break};
|
||||
use text::TextRunScanner;
|
||||
|
|
|
@ -8,7 +8,7 @@ use flow::{IS_ABSOLUTELY_POSITIONED};
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::float;
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
bitflags! {
|
||||
#[doc = "Individual layout actions that may be necessary after restyling."]
|
||||
|
|
|
@ -36,7 +36,7 @@ use std::ops::{Add, Sub, Mul, Div, Rem, Neg, Shl, Shr, Not, BitOr, BitAnd, BitXo
|
|||
use std::u16;
|
||||
use style::computed_values::{overflow, text_align, text_justify, text_overflow, vertical_align};
|
||||
use style::computed_values::{white_space};
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
// From gfxFontConstants.h in Firefox
|
||||
|
|
|
@ -65,9 +65,11 @@ use std::ops::{Deref, DerefMut};
|
|||
use std::sync::mpsc::{channel, Sender, Receiver, Select};
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use style::selector_matching::Stylist;
|
||||
use style::computed_values::{filter, mix_blend_mode};
|
||||
use style::{StylesheetOrigin, Stylesheet, Stylist, TNode, iter_font_face_rules};
|
||||
use style::{MediaType, Device};
|
||||
use style::stylesheets::{Origin, Stylesheet, iter_font_face_rules};
|
||||
use style::node::TNode;
|
||||
use style::media_queries::{MediaType, Device};
|
||||
use std::sync::{Arc, Mutex, MutexGuard};
|
||||
use url::Url;
|
||||
|
||||
|
@ -488,7 +490,7 @@ impl LayoutTask {
|
|||
final_url,
|
||||
protocol_encoding_label,
|
||||
Some(environment_encoding),
|
||||
StylesheetOrigin::Author);
|
||||
Origin::Author);
|
||||
self.handle_add_stylesheet(sheet, possibly_locked_rw_data);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ use gfx::display_list::DisplayList;
|
|||
use servo_util::geometry::Au;
|
||||
use servo_util::logical_geometry::LogicalRect;
|
||||
use servo_util::opts;
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use style::computed_values::list_style_type;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
use fragment::Fragment;
|
||||
|
||||
use style::computed_values as computed;
|
||||
use geom::SideOffsets2D;
|
||||
use style::computed_values::{LengthOrPercentageOrAuto, LengthOrPercentage};
|
||||
use style::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, LengthOrPercentage};
|
||||
use style::properties::ComputedValues;
|
||||
use servo_util::geometry::Au;
|
||||
use servo_util::logical_geometry::LogicalMargin;
|
||||
use std::cmp::{max, min};
|
||||
|
@ -333,14 +332,14 @@ pub enum MaybeAuto {
|
|||
|
||||
impl MaybeAuto {
|
||||
#[inline]
|
||||
pub fn from_style(length: computed::LengthOrPercentageOrAuto, containing_length: Au)
|
||||
pub fn from_style(length: LengthOrPercentageOrAuto, containing_length: Au)
|
||||
-> MaybeAuto {
|
||||
match length {
|
||||
computed::LengthOrPercentageOrAuto::Auto => MaybeAuto::Auto,
|
||||
computed::LengthOrPercentageOrAuto::Percentage(percent) => {
|
||||
LengthOrPercentageOrAuto::Auto => MaybeAuto::Auto,
|
||||
LengthOrPercentageOrAuto::Percentage(percent) => {
|
||||
MaybeAuto::Specified(containing_length.scale_by(percent))
|
||||
}
|
||||
computed::LengthOrPercentageOrAuto::Length(length) => MaybeAuto::Specified(length)
|
||||
LengthOrPercentageOrAuto::Length(length) => MaybeAuto::Specified(length)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -366,18 +365,18 @@ impl MaybeAuto {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn specified_or_none(length: computed::LengthOrPercentageOrNone, containing_length: Au) -> Option<Au> {
|
||||
pub fn specified_or_none(length: LengthOrPercentageOrNone, containing_length: Au) -> Option<Au> {
|
||||
match length {
|
||||
computed::LengthOrPercentageOrNone::None => None,
|
||||
computed::LengthOrPercentageOrNone::Percentage(percent) => Some(containing_length.scale_by(percent)),
|
||||
computed::LengthOrPercentageOrNone::Length(length) => Some(length),
|
||||
LengthOrPercentageOrNone::None => None,
|
||||
LengthOrPercentageOrNone::Percentage(percent) => Some(containing_length.scale_by(percent)),
|
||||
LengthOrPercentageOrNone::Length(length) => Some(length),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn specified(length: computed::LengthOrPercentage, containing_length: Au) -> Au {
|
||||
pub fn specified(length: LengthOrPercentage, containing_length: Au) -> Au {
|
||||
match length {
|
||||
computed::LengthOrPercentage::Length(length) => length,
|
||||
computed::LengthOrPercentage::Percentage(p) => containing_length.scale_by(p)
|
||||
LengthOrPercentage::Length(length) => length,
|
||||
LengthOrPercentage::Percentage(p) => containing_length.scale_by(p)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@ use servo_util::geometry::Au;
|
|||
use servo_util::logical_geometry::LogicalRect;
|
||||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
use style::{ComputedValues, CSSFloat};
|
||||
use style::computed_values::{LengthOrPercentageOrAuto, table_layout};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::{LengthOrPercentageOrAuto};
|
||||
use style::computed_values::table_layout;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A table flow corresponded to the table's internal table fragment under a table wrapper flow.
|
||||
|
|
|
@ -17,7 +17,7 @@ use geom::{Point2D, Rect};
|
|||
use servo_util::geometry::Au;
|
||||
use servo_util::logical_geometry::LogicalRect;
|
||||
use std::fmt;
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -19,7 +19,8 @@ use geom::{Point2D, Rect};
|
|||
use servo_util::geometry::Au;
|
||||
use servo_util::logical_geometry::LogicalRect;
|
||||
use std::fmt;
|
||||
use style::{UnsignedIntegerAttribute, ComputedValues};
|
||||
use style::properties::ComputedValues;
|
||||
use style::legacy::UnsignedIntegerAttribute;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -17,8 +17,8 @@ use geom::{Point2D, Rect};
|
|||
use servo_util::geometry::{Au, ZERO_RECT};
|
||||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
use style::computed_values::LengthOrPercentageOrAuto;
|
||||
use style::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -23,8 +23,8 @@ use servo_util::geometry::Au;
|
|||
use servo_util::logical_geometry::LogicalRect;
|
||||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
use style::ComputedValues;
|
||||
use style::computed_values::LengthOrPercentageOrAuto;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A single row of a table.
|
||||
|
|
|
@ -19,7 +19,7 @@ use geom::{Point2D, Rect};
|
|||
use servo_util::geometry::Au;
|
||||
use servo_util::logical_geometry::LogicalRect;
|
||||
use std::fmt;
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A table formatting context.
|
||||
|
|
|
@ -28,8 +28,10 @@ use servo_util::geometry::Au;
|
|||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use std::ops::Add;
|
||||
use style::{ComputedValues, CSSFloat};
|
||||
use style::computed_values::{table_layout, LengthOrPercentageOrAuto};
|
||||
use style::properties::ComputedValues;
|
||||
use style::computed_values::table_layout;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Copy, RustcEncodable, Show)]
|
||||
|
|
|
@ -22,10 +22,10 @@ use servo_util::range::Range;
|
|||
use servo_util::smallvec::{SmallVec, SmallVec1};
|
||||
use std::collections::DList;
|
||||
use std::mem;
|
||||
use style::ComputedValues;
|
||||
use style::computed_values::{line_height, text_orientation, text_rendering, text_transform};
|
||||
use style::computed_values::{white_space};
|
||||
use style::style_structs::Font as FontStyle;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs::Font as FontStyle;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A stack-allocated object for scanning an inline flow into `TextRun`-containing `TextFragment`s.
|
||||
|
|
|
@ -19,7 +19,7 @@ use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
|
|||
use servo_util::bloom::BloomFilter;
|
||||
use servo_util::opts;
|
||||
use servo_util::tid::tid;
|
||||
use style::TNode;
|
||||
use style::node::TNode;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::mem;
|
||||
|
|
|
@ -17,7 +17,7 @@ use script::layout_interface::{LayoutChan, TrustedNodeAddress};
|
|||
use script_traits::UntrustedNodeAddress;
|
||||
use std::mem;
|
||||
use std::cell::{Ref, RefMut};
|
||||
use style::ComputedValues;
|
||||
use style::properties::ComputedValues;
|
||||
use style;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -176,7 +176,7 @@ pub trait ToGfxColor {
|
|||
fn to_gfx_color(&self) -> gfx::color::Color;
|
||||
}
|
||||
|
||||
impl ToGfxColor for style::computed_values::RGBA {
|
||||
impl ToGfxColor for style::values::RGBA {
|
||||
fn to_gfx_color(&self) -> gfx::color::Color {
|
||||
gfx::color::rgba(self.red, self.green, self.blue, self.alpha)
|
||||
}
|
||||
|
|
|
@ -66,9 +66,10 @@ use std::mem;
|
|||
use std::sync::mpsc::Sender;
|
||||
use string_cache::{Atom, Namespace};
|
||||
use style::computed_values::{content, display, white_space};
|
||||
use style::{NamespaceConstraint, AttrSelector, IntegerAttribute};
|
||||
use style::{LengthAttribute, PropertyDeclarationBlock, SimpleColorAttribute};
|
||||
use style::{TElement, TElementAttributes, TNode, UnsignedIntegerAttribute};
|
||||
use style::selectors::{NamespaceConstraint, AttrSelector};
|
||||
use style::legacy::{LengthAttribute, SimpleColorAttribute, UnsignedIntegerAttribute, IntegerAttribute};
|
||||
use style::node::{TElement, TElementAttributes, TNode};
|
||||
use style::properties::PropertyDeclarationBlock;
|
||||
use url::Url;
|
||||
|
||||
/// Allows some convenience methods on generic layout nodes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue