aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2016-07-19 20:29:22 +0200
committerSimon Sapin <simon.sapin@exyr.org>2016-07-20 08:42:40 +0200
commit789807b7b09e0742a197c98efd2f81b85b751a57 (patch)
treee093027760cf23719d9f6b3e279eab46e9b3168f /components/layout
parentb2a7e4437391abd92486d5bef879fadadabab162 (diff)
downloadservo-789807b7b09e0742a197c98efd2f81b85b751a57.tar.gz
servo-789807b7b09e0742a197c98efd2f81b85b751a57.zip
Remove the ComputedValue traits and style_struct_traits
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/animation.rs13
-rw-r--r--components/layout/block.rs2
-rw-r--r--components/layout/construct.rs2
-rw-r--r--components/layout/context.rs4
-rw-r--r--components/layout/display_list_builder.rs6
-rw-r--r--components/layout/flex.rs2
-rw-r--r--components/layout/flow.rs2
-rw-r--r--components/layout/fragment.rs2
-rw-r--r--components/layout/generated_content.rs2
-rw-r--r--components/layout/inline.rs2
-rw-r--r--components/layout/list_item.rs2
-rw-r--r--components/layout/model.rs2
-rw-r--r--components/layout/multicol.rs2
-rw-r--r--components/layout/query.rs5
-rw-r--r--components/layout/table.rs2
-rw-r--r--components/layout/table_cell.rs2
-rw-r--r--components/layout/table_row.rs2
-rw-r--r--components/layout/table_rowgroup.rs2
-rw-r--r--components/layout/table_wrapper.rs2
-rw-r--r--components/layout/text.rs8
-rw-r--r--components/layout/traversal.rs3
-rw-r--r--components/layout/wrapper.rs1
22 files changed, 33 insertions, 37 deletions
diff --git a/components/layout/animation.rs b/components/layout/animation.rs
index 8f0ac53bd45..4087479ed47 100644
--- a/components/layout/animation.rs
+++ b/components/layout/animation.rs
@@ -14,17 +14,16 @@ use script_traits::{AnimationState, LayoutMsg as ConstellationMsg};
use std::collections::HashMap;
use std::sync::mpsc::Receiver;
use style::animation::{Animation, update_style_for_animation};
-use style::selector_impl::{SelectorImplExt, ServoSelectorImpl};
use time;
/// Processes any new animations that were discovered after style recalculation.
/// Also expire any old animations that have completed, inserting them into
/// `expired_animations`.
-pub fn update_animation_state<Impl: SelectorImplExt>(constellation_chan: &IpcSender<ConstellationMsg>,
- running_animations: &mut HashMap<OpaqueNode, Vec<Animation<Impl>>>,
- expired_animations: &mut HashMap<OpaqueNode, Vec<Animation<Impl>>>,
- new_animations_receiver: &Receiver<Animation<Impl>>,
- pipeline_id: PipelineId) {
+pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
+ running_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
+ expired_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
+ new_animations_receiver: &Receiver<Animation>,
+ pipeline_id: PipelineId) {
let mut new_running_animations = vec![];
while let Ok(animation) = new_animations_receiver.try_recv() {
let mut should_push = true;
@@ -125,7 +124,7 @@ pub fn update_animation_state<Impl: SelectorImplExt>(constellation_chan: &IpcSen
pub fn recalc_style_for_animations(context: &SharedLayoutContext,
flow: &mut Flow,
animations: &HashMap<OpaqueNode,
- Vec<Animation<ServoSelectorImpl>>>) {
+ Vec<Animation>>) {
let mut damage = RestyleDamage::empty();
flow.mutate_fragments(&mut |fragment| {
if let Some(ref animations) = animations.get(&fragment.node) {
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 41d382f3004..a1d27506da3 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -58,7 +58,7 @@ use style::computed_values::{border_collapse, box_sizing, display, float, overfl
use style::computed_values::{position, text_align, transform, transform_style};
use style::context::StyleContext;
use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 2b1b2f49cdc..ba87cfd9dbc 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -46,7 +46,7 @@ use std::sync::atomic::Ordering;
use style::computed_values::content::ContentItem;
use style::computed_values::position;
use style::computed_values::{caption_side, display, empty_cells, float, list_style_position};
-use style::properties::{self, ComputedValues, ServoComputedValues};
+use style::properties::{self, ServoComputedValues};
use style::servo::SharedStyleContext;
use table::TableFlow;
use table_caption::TableCaptionFlow;
diff --git a/components/layout/context.rs b/components/layout/context.rs
index 08237579626..9fed4959310 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -31,7 +31,7 @@ use url::Url;
use util::opts;
struct LocalLayoutContext {
- style_context: LocalStyleContext<ServoSelectorImpl>,
+ style_context: LocalStyleContext,
font_context: RefCell<FontContext>,
}
@@ -108,7 +108,7 @@ impl<'a> StyleContext<'a, ServoSelectorImpl> for LayoutContext<'a> {
&self.shared.style_context
}
- fn local_context(&self) -> &LocalStyleContext<ServoSelectorImpl> {
+ fn local_context(&self) -> &LocalStyleContext {
&self.cached_local_layout_context.style_context
}
}
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 4bc969b2e74..5eb20156295 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -50,8 +50,8 @@ use style::computed_values::{background_repeat, background_size, border_style};
use style::computed_values::{cursor, image_rendering, overflow_x, pointer_events, position};
use style::computed_values::{transform, transform_style, visibility};
use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
-use style::properties::style_structs::ServoBorder;
-use style::properties::{self, ComputedValues, ServoComputedValues};
+use style::properties::style_structs;
+use style::properties::{self, ServoComputedValues};
use style::values::RGBA;
use style::values::computed;
use style::values::computed::{LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto, LinearGradient};
@@ -315,7 +315,7 @@ fn handle_overlapping_radii(size: &Size2D<Au>, radii: &BorderRadii<Au>) -> Borde
}
}
-fn build_border_radius(abs_bounds: &Rect<Au>, border_style: &ServoBorder) -> BorderRadii<Au> {
+fn build_border_radius(abs_bounds: &Rect<Au>, border_style: &style_structs::Border) -> BorderRadii<Au> {
// TODO(cgaebel): Support border radii even in the case of multiple border widths.
// This is an extension of supporting elliptical radii. For now, all percentage
// radii will be relative to the width.
diff --git a/components/layout/flex.rs b/components/layout/flex.rs
index 031ebb03e8b..7392ccaf542 100644
--- a/components/layout/flex.rs
+++ b/components/layout/flex.rs
@@ -26,7 +26,7 @@ use std::cmp::max;
use std::sync::Arc;
use style::computed_values::flex_direction;
use style::logical_geometry::LogicalSize;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index c9c3e2d9054..7be81faa0d6 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -52,7 +52,7 @@ use std::{fmt, mem, raw};
use style::computed_values::{clear, display, empty_cells, float, position, overflow_x, text_align};
use style::dom::TRestyleDamage;
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
-use style::properties::{self, ComputedValues, ServoComputedValues};
+use style::properties::{self, ServoComputedValues};
use style::servo::SharedStyleContext;
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 5d101ffc4d2..f235bd64331 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -44,7 +44,7 @@ use style::computed_values::{overflow_wrap, overflow_x, position, text_decoratio
use style::computed_values::{transform_style, vertical_align, white_space, word_break, z_index};
use style::dom::TRestyleDamage;
use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::str::char_is_whitespace;
use style::values::computed::LengthOrPercentageOrNone;
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs
index 33a1d21f0d1..cb60fe70100 100644
--- a/components/layout/generated_content.rs
+++ b/components/layout/generated_content.rs
@@ -21,7 +21,7 @@ use std::sync::Arc;
use style::computed_values::content::ContentItem;
use style::computed_values::{display, list_style_type};
use style::dom::TRestyleDamage;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use text::TextRunScanner;
// Decimal styles per CSS-COUNTER-STYLES § 6.1:
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 42dd01d87b9..8c6e9c4f337 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -37,7 +37,7 @@ use style::computed_values::{display, overflow_x, position, text_align, text_jus
use style::computed_values::{text_overflow, vertical_align, white_space};
use style::context::StyleContext;
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::computed::LengthOrPercentage;
use text;
diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs
index f32c3ec873f..84a9b1322e4 100644
--- a/components/layout/list_item.rs
+++ b/components/layout/list_item.rs
@@ -24,7 +24,7 @@ use script_layout_interface::restyle_damage::RESOLVE_GENERATED_CONTENT;
use std::sync::Arc;
use style::computed_values::{list_style_type, position};
use style::logical_geometry::LogicalSize;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use text;
diff --git a/components/layout/model.rs b/components/layout/model.rs
index 152fa10b532..bb9bb1736fc 100644
--- a/components/layout/model.rs
+++ b/components/layout/model.rs
@@ -13,7 +13,7 @@ use std::cmp::{max, min};
use std::fmt;
use style::computed_values::transform::ComputedMatrix;
use style::logical_geometry::LogicalMargin;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index e2bb1a66f79..a30fbaf1a02 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -23,7 +23,7 @@ use std::fmt;
use std::sync::Arc;
use style::context::StyleContext;
use style::logical_geometry::LogicalSize;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
diff --git a/components/layout/query.rs b/components/layout/query.rs
index ea22bd966d5..7467c80fffb 100644
--- a/components/layout/query.rs
+++ b/components/layout/query.rs
@@ -31,7 +31,6 @@ use std::sync::{Arc, Mutex};
use string_cache::Atom;
use style::computed_values;
use style::logical_geometry::{WritingMode, BlockFlowDirection, InlineBaseDirection};
-use style::properties::ComputedValues;
use style::properties::longhands::{display, position};
use style::properties::style_structs;
use style::selector_impl::PseudoElement;
@@ -450,7 +449,7 @@ impl ParentOffsetBorderBoxIterator {
impl FragmentBorderBoxIterator for FragmentLocatingFragmentIterator {
fn process(&mut self, fragment: &Fragment, _: i32, border_box: &Rect<Au>) {
- let style_structs::ServoBorder {
+ let style_structs::Border {
border_top_width: top_width,
border_right_width: right_width,
border_bottom_width: bottom_width,
@@ -476,7 +475,7 @@ impl FragmentBorderBoxIterator for UnioningFragmentScrollAreaIterator {
// increase in size. To work around this, we store the original elements padding
// rectangle as `origin_rect` and the union of all child elements padding and
// margin rectangles as `union_rect`.
- let style_structs::ServoBorder {
+ let style_structs::Border {
border_top_width: top_border,
border_right_width: right_border,
border_bottom_width: bottom_border,
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 4f41cdb681f..a78580c565a 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -27,7 +27,7 @@ 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, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index 1e36adc65af..691a3483444 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -25,7 +25,7 @@ use std::fmt;
use std::sync::Arc;
use style::computed_values::{border_collapse, border_top_style, vertical_align};
use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use table::InternalTable;
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 0406b7a806b..ae931481ddd 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -27,7 +27,7 @@ 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, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index 21d6a00cb74..26f828e8765 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -23,7 +23,7 @@ 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, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
use table_row;
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index b88819274e1..e8fec9e94e6 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -32,7 +32,7 @@ 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, ServoComputedValues};
+use style::properties::ServoComputedValues;
use style::servo::SharedStyleContext;
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
diff --git a/components/layout/text.rs b/components/layout/text.rs
index 2b60fb1ee74..85e0f620290 100644
--- a/components/layout/text.rs
+++ b/components/layout/text.rs
@@ -25,8 +25,8 @@ use std::sync::Arc;
use style::computed_values::white_space;
use style::computed_values::{line_height, text_orientation, text_rendering, text_transform};
use style::logical_geometry::{LogicalSize, WritingMode};
-use style::properties::style_structs::ServoFont;
-use style::properties::{ComputedValues, ServoComputedValues};
+use style::properties::ServoComputedValues;
+use style::properties::style_structs;
use unicode_bidi::{is_rtl, process_text};
use unicode_script::{get_script, Script};
@@ -431,11 +431,11 @@ fn bounding_box_for_run_metrics(metrics: &RunMetrics, writing_mode: WritingMode)
}
-/// Returns the metrics of the font represented by the given `ServoFont`, respectively.
+/// Returns the metrics of the font represented by the given `style_structs::Font`, respectively.
///
/// `#[inline]` because often the caller only needs a few fields from the font metrics.
#[inline]
-pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc<ServoFont>)
+pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc<style_structs::Font>)
-> FontMetrics {
let fontgroup = font_context.layout_font_group_for_style(font_style);
// FIXME(https://github.com/rust-lang/rust/issues/23338)
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index 581fee5e03d..194e72bddcc 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -14,7 +14,6 @@ use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
use std::mem;
use style::dom::TNode;
-use style::properties::ServoComputedValues;
use style::selector_impl::ServoSelectorImpl;
use style::servo::SharedStyleContext;
use style::traversal::{DomTraversalContext, remove_from_bloom_filter, recalc_style_at};
@@ -27,7 +26,7 @@ pub struct RecalcStyleAndConstructFlows<'lc> {
}
impl<'lc, N> DomTraversalContext<N> for RecalcStyleAndConstructFlows<'lc>
- where N: LayoutNode + TNode<ConcreteComputedValues=ServoComputedValues>,
+ where N: LayoutNode + TNode,
N::ConcreteElement: ::selectors::Element<Impl=ServoSelectorImpl, AttrString=String>
{
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index 0f83454ab57..bab6d1d8e20 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -35,7 +35,6 @@ use data::{LayoutDataFlags, PrivateLayoutData};
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData};
use style::computed_values::content::{self, ContentItem};
-use style::properties::ComputedValues;
use style::refcell::{Ref, RefCell, RefMut};
pub type NonOpaqueStyleAndLayoutData = *mut RefCell<PrivateLayoutData>;