ComputedValues is now ServoComputedValues

This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
This commit is contained in:
Per Lundberg 2016-03-26 23:07:44 +02:00
parent bed91b3334
commit c2ad084713
28 changed files with 135 additions and 139 deletions

View file

@ -57,7 +57,7 @@ use style::computed_values::{border_collapse, box_sizing, display, float, overfl
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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use util::geometry::MAX_RECT;
@ -2033,7 +2033,7 @@ impl Flow for BlockFlow {
self.fragment.restyle_damage.remove(REPAINT);
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.fragment.repair_style(new_style)
}
@ -2955,4 +2955,3 @@ pub enum BlockStackingContextType {
PseudoStackingContext,
StackingContext,
}

View file

@ -45,7 +45,7 @@ use std::sync::atomic::Ordering;
use style::computed_values::content::ContentItem;
use style::computed_values::{caption_side, display, empty_cells, float, list_style_position};
use style::computed_values::{position};
use style::properties::{self, ComputedValues, TComputedValues};
use style::properties::{self, ServoComputedValues, TComputedValues};
use table::TableFlow;
use table_caption::TableCaptionFlow;
use table_cell::TableCellFlow;
@ -105,7 +105,7 @@ pub enum ConstructionItem {
/// Inline fragments and associated {ib} splits that have not yet found flows.
InlineFragments(InlineFragmentsConstructionResult),
/// Potentially ignorable whitespace.
Whitespace(OpaqueNode, PseudoElementType<()>, Arc<ComputedValues>, RestyleDamage),
Whitespace(OpaqueNode, PseudoElementType<()>, Arc<ServoComputedValues>, RestyleDamage),
/// TableColumn Fragment
TableColumnFragment(Fragment),
}
@ -702,7 +702,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
fn create_fragments_for_node_text_content(&self,
fragments: &mut IntermediateInlineFragments,
node: &ConcreteThreadSafeLayoutNode,
style: &Arc<ComputedValues>) {
style: &Arc<ServoComputedValues>) {
// Fast path: If there is no text content, return immediately.
let text_content = node.text_content();
if text_content.is_empty() {
@ -1821,7 +1821,7 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList<Fragment>) {
/// If the 'unicode-bidi' property has a value other than 'normal', return the bidi control codes
/// to inject before and after the text content of the element.
fn bidi_control_chars(style: &Arc<ComputedValues>) -> Option<(&'static str, &'static str)> {
fn bidi_control_chars(style: &Arc<ServoComputedValues>) -> Option<(&'static str, &'static str)> {
use style::computed_values::direction::T::*;
use style::computed_values::unicode_bidi::T::*;

View file

@ -26,14 +26,14 @@ use std::rc::Rc;
use std::sync::{Arc, Mutex, RwLock};
use style::context::{LocalStyleContext, StyleContext};
use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use style::properties::ComputedValues;
use style::properties::ServoComputedValues;
use style::selector_impl::ServoSelectorImpl;
use style::servo::SharedStyleContext;
use url::Url;
use util::opts;
struct LocalLayoutContext {
style_context: LocalStyleContext<ComputedValues>,
style_context: LocalStyleContext<ServoComputedValues>,
font_context: RefCell<FontContext>,
}
@ -108,12 +108,12 @@ pub struct LayoutContext<'a> {
cached_local_layout_context: Rc<LocalLayoutContext>,
}
impl<'a> StyleContext<'a, ServoSelectorImpl, ComputedValues> for LayoutContext<'a> {
impl<'a> StyleContext<'a, ServoSelectorImpl, ServoComputedValues> for LayoutContext<'a> {
fn shared_context(&self) -> &'a SharedStyleContext {
&self.shared.style_context
}
fn local_context(&self) -> &LocalStyleContext<ComputedValues> {
fn local_context(&self) -> &LocalStyleContext<ServoComputedValues> {
&self.cached_local_layout_context.style_context
}
}
@ -234,4 +234,3 @@ impl<'a> LayoutContext<'a> {
}
}
}

View file

@ -51,7 +51,7 @@ 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, TComputedValues};
use style::properties::{self, ServoComputedValues, TComputedValues};
use style::values::RGBA;
use style::values::computed;
use style::values::computed::{LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto, LinearGradient};
@ -130,7 +130,7 @@ pub trait FragmentDisplayListBuilding {
/// list if necessary.
fn build_display_list_for_background_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion);
@ -138,7 +138,7 @@ pub trait FragmentDisplayListBuilding {
/// Computes the background size for an image with the given background area according to the
/// rules in CSS-BACKGROUNDS § 3.9.
fn compute_background_image_size(&self,
style: &ComputedValues,
style: &ServoComputedValues,
bounds: &Rect<Au>,
image: &WebRenderImageInfo)
-> Size2D<Au>;
@ -147,7 +147,7 @@ pub trait FragmentDisplayListBuilding {
/// appropriate section of the display list.
fn build_display_list_for_background_image(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion,
@ -161,14 +161,14 @@ pub trait FragmentDisplayListBuilding {
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion,
gradient: &LinearGradient,
style: &ComputedValues);
style: &ServoComputedValues);
/// Adds the display items necessary to paint the borders of this fragment to a display list if
/// necessary.
fn build_display_list_for_borders_if_applicable(
&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
border_painting_mode: BorderPaintingMode,
bounds: &Rect<Au>,
display_list_section: DisplayListSection,
@ -178,7 +178,7 @@ pub trait FragmentDisplayListBuilding {
/// if necessary.
fn build_display_list_for_outline_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
bounds: &Rect<Au>,
clip: &ClippingRegion);
@ -186,7 +186,7 @@ pub trait FragmentDisplayListBuilding {
/// list if necessary.
fn build_display_list_for_box_shadow_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion);
@ -194,7 +194,7 @@ pub trait FragmentDisplayListBuilding {
/// Adds display items necessary to draw debug boxes around a scanned text fragment.
fn build_debug_borders_around_text_fragments(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
stacking_relative_border_box: &Rect<Au>,
stacking_relative_content_box: &Rect<Au>,
text_fragment: &ScannedTextFragmentInfo,
@ -331,7 +331,7 @@ fn build_border_radius(abs_bounds: &Rect<Au>, border_style: &Border) -> BorderRa
impl FragmentDisplayListBuilding for Fragment {
fn build_display_list_for_background_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion) {
@ -406,7 +406,7 @@ impl FragmentDisplayListBuilding for Fragment {
}
fn compute_background_image_size(&self,
style: &ComputedValues,
style: &ServoComputedValues,
bounds: &Rect<Au>,
image: &WebRenderImageInfo)
-> Size2D<Au> {
@ -460,7 +460,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn build_display_list_for_background_image(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion,
@ -581,7 +581,7 @@ impl FragmentDisplayListBuilding for Fragment {
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion,
gradient: &LinearGradient,
style: &ComputedValues) {
style: &ServoComputedValues) {
let mut clip = clip.clone();
clip.intersect_rect(absolute_bounds);
@ -697,7 +697,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn build_display_list_for_box_shadow_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
clip: &ClippingRegion) {
@ -736,7 +736,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn build_display_list_for_borders_if_applicable(
&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
border_painting_mode: BorderPaintingMode,
bounds: &Rect<Au>,
display_list_section: DisplayListSection,
@ -799,7 +799,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn build_display_list_for_outline_if_applicable(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
bounds: &Rect<Au>,
clip: &ClippingRegion) {
let width = style.get_outline().outline_width;
@ -838,7 +838,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn build_debug_borders_around_text_fragments(&self,
state: &mut DisplayListBuildState,
style: &ComputedValues,
style: &ServoComputedValues,
stacking_relative_border_box: &Rect<Au>,
stacking_relative_content_box: &Rect<Au>,
text_fragment: &ScannedTextFragmentInfo,

View file

@ -28,7 +28,7 @@ use std::sync::Arc;
use style::computed_values::flex_direction;
use style::logical_geometry::LogicalSize;
use style::properties::style_structs;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
// A mode describes which logical axis a flex axis is parallel with.
@ -414,7 +414,7 @@ impl Flow for FlexFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -50,7 +50,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, TComputedValues};
use style::properties::{self, ServoComputedValues, TComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
use table_caption::TableCaptionFlow;
@ -410,7 +410,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with
/// the new style. This can only succeed if the flow has exactly one fragment.
fn repair_style(&mut self, new_style: &Arc<ComputedValues>);
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>);
/// Print any extra children (such as fragments) contained in this Flow
/// for debugging purposes. Any items inserted into the tree will become
@ -542,7 +542,7 @@ pub trait MutableFlowUtils {
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
/// calling them individually, since there is no reason not to perform both operations.
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>);
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ServoComputedValues>);
}
pub trait MutableOwnedFlowUtils {
@ -1051,7 +1051,7 @@ pub enum ForceNonfloatedFlag {
impl BaseFlow {
#[inline]
pub fn new(style: Option<&ComputedValues>,
pub fn new(style: Option<&ServoComputedValues>,
writing_mode: WritingMode,
force_nonfloated: ForceNonfloatedFlag)
-> BaseFlow {
@ -1422,7 +1422,7 @@ impl<'a> MutableFlowUtils for &'a mut Flow {
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
/// calling them individually, since there is no reason not to perform both operations.
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>) {
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ServoComputedValues>) {
self.repair_style(style);
self.bubble_inline_sizes();
}
@ -1579,4 +1579,3 @@ impl OpaqueFlow {
}
}
}

View file

@ -41,7 +41,7 @@ use style::computed_values::{overflow_x, position, text_decoration, transform_st
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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentageOrNone};
use text;
@ -83,7 +83,7 @@ pub struct Fragment {
pub node: OpaqueNode,
/// The CSS style of this fragment.
pub style: Arc<ComputedValues>,
pub style: Arc<ServoComputedValues>,
/// The position of this fragment relative to its owning flow. The size includes padding and
/// border, but not margin.
@ -485,7 +485,7 @@ impl ReplacedImageFragmentInfo {
}
pub fn calculate_replaced_inline_size(&mut self,
style: &ComputedValues,
style: &ServoComputedValues,
noncontent_inline_size: Au,
container_inline_size: Au,
fragment_inline_size: Au,
@ -540,7 +540,7 @@ impl ReplacedImageFragmentInfo {
}
pub fn calculate_replaced_block_size(&mut self,
style: &ComputedValues,
style: &ServoComputedValues,
noncontent_block_size: Au,
containing_block_block_size: Option<Au>,
fragment_inline_size: Au,
@ -596,7 +596,7 @@ impl IframeFragmentInfo {
}
#[inline]
pub fn calculate_replaced_inline_size(&self, style: &ComputedValues, containing_size: Au)
pub fn calculate_replaced_inline_size(&self, style: &ServoComputedValues, containing_size: Au)
-> Au {
// Calculate the replaced inline size (or default) as per CSS 2.1 § 10.3.2
IframeFragmentInfo::calculate_replaced_size(style.content_inline_size(),
@ -607,7 +607,7 @@ impl IframeFragmentInfo {
}
#[inline]
pub fn calculate_replaced_block_size(&self, style: &ComputedValues, containing_size: Option<Au>)
pub fn calculate_replaced_block_size(&self, style: &ServoComputedValues, containing_size: Option<Au>)
-> Au {
// Calculate the replaced block size (or default) as per CSS 2.1 § 10.3.2
IframeFragmentInfo::calculate_replaced_size(style.content_block_size(),
@ -814,7 +814,7 @@ impl Fragment {
/// Constructs a new `Fragment` instance from an opaque node.
pub fn from_opaque_node_and_style(node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: Arc<ComputedValues>,
style: Arc<ServoComputedValues>,
mut restyle_damage: RestyleDamage,
specific: SpecificFragmentInfo)
-> Fragment {
@ -1229,7 +1229,7 @@ impl Fragment {
// Return offset from original position because of `position: relative`.
pub fn relative_position(&self, containing_block_size: &LogicalSize<Au>) -> LogicalSize<Au> {
fn from_style(style: &ComputedValues, container_size: &LogicalSize<Au>)
fn from_style(style: &ServoComputedValues, container_size: &LogicalSize<Au>)
-> LogicalSize<Au> {
let offsets = style.logical_position();
let offset_i = if offsets.inline_start != LengthOrPercentageOrAuto::Auto {
@ -1282,7 +1282,7 @@ impl Fragment {
}
#[inline(always)]
pub fn style(&self) -> &ComputedValues {
pub fn style(&self) -> &ServoComputedValues {
&*self.style
}
@ -2087,7 +2087,7 @@ impl Fragment {
}
}
pub fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
pub fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.style = (*new_style).clone()
}
@ -2576,9 +2576,9 @@ pub struct InlineStyleIterator<'a> {
}
impl<'a> Iterator for InlineStyleIterator<'a> {
type Item = &'a ComputedValues;
type Item = &'a ServoComputedValues;
fn next(&mut self) -> Option<&'a ComputedValues> {
fn next(&mut self) -> Option<&'a ServoComputedValues> {
if !self.primary_style_yielded {
self.primary_style_yielded = true;
return Some(&*self.fragment.style)
@ -2675,4 +2675,3 @@ pub struct SpeculatedInlineContentEdgeOffsets {
pub start: Au,
pub end: Au,
}

View file

@ -20,7 +20,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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use text::TextRunScanner;
use wrapper::PseudoElementType;
@ -297,7 +297,7 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
self.incremented = true
}
fn quote(&self, style: &ComputedValues, close: bool) -> String {
fn quote(&self, style: &ServoComputedValues, close: bool) -> String {
let quotes = &style.get_list().quotes;
if quotes.0.is_empty() {
return String::new()
@ -367,7 +367,7 @@ impl Counter {
layout_context: &LayoutContext,
node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: Arc<ComputedValues>,
style: Arc<ServoComputedValues>,
list_style_type: list_style_type::T,
mode: RenderingMode)
-> Option<SpecificFragmentInfo> {
@ -430,7 +430,7 @@ struct CounterValue {
fn render_text(layout_context: &LayoutContext,
node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: Arc<ComputedValues>,
style: Arc<ServoComputedValues>,
string: String)
-> Option<SpecificFragmentInfo> {
let mut fragments = LinkedList::new();

View file

@ -7,7 +7,7 @@ use std::fmt;
use std::sync::Arc;
use style::computed_values::float;
use style::dom::TRestyleDamage;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
bitflags! {
#[doc = "Individual layout actions that may be necessary after restyling."]
@ -53,8 +53,9 @@ bitflags! {
}
impl TRestyleDamage for RestyleDamage {
type ConcreteComputedValues = ComputedValues;
fn compute(old: Option<&Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage { compute_damage(old, new) }
type ConcreteComputedValues = ServoComputedValues;
fn compute(old: Option<&Arc<ServoComputedValues>>, new: &ServoComputedValues) ->
RestyleDamage { compute_damage(old, new) }
/// Returns a bitmask that represents a flow that needs to be rebuilt and reflowed.
///
@ -153,8 +154,8 @@ macro_rules! add_if_not_equal(
})
);
pub fn compute_damage(old: Option<&Arc<ComputedValues>>, new: &ComputedValues) -> RestyleDamage {
let old: &ComputedValues = match old {
pub fn compute_damage(old: Option<&Arc<ServoComputedValues>>, new: &ServoComputedValues) -> RestyleDamage {
let old: &ServoComputedValues = match old {
None => return RestyleDamage::rebuild_and_reflow(),
Some(cv) => &**cv,
};
@ -162,7 +163,7 @@ pub fn compute_damage(old: Option<&Arc<ComputedValues>>, new: &ComputedValues) -
let mut damage = RestyleDamage::empty();
// This should check every CSS property, as enumerated in the fields of
// http://doc.servo.org/style/properties/struct.ComputedValues.html
// http://doc.servo.org/style/properties/struct.ServoComputedValues.html
// FIXME: Test somehow that every property is included.

View file

@ -30,7 +30,7 @@ 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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::LengthOrPercentage;
use text;
use unicode_bidi;
@ -1176,7 +1176,7 @@ impl InlineFlow {
/// `style` is the style of the block.
pub fn compute_minimum_ascent_and_descent(&self,
font_context: &mut FontContext,
style: &ComputedValues)
style: &ServoComputedValues)
-> (Au, Au) {
// As a special case, if this flow contains only hypothetical fragments, then the entire
// flow is hypothetical and takes up no space. See CSS 2.1 § 10.3.7.
@ -1761,7 +1761,7 @@ impl Flow for InlineFlow {
}
}
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
fn repair_style(&mut self, _: &Arc<ServoComputedValues>) {}
fn compute_overflow(&self) -> Overflow {
let mut overflow = Overflow::new();
@ -1850,7 +1850,7 @@ impl fmt::Debug for InlineFlow {
#[derive(Clone)]
pub struct InlineFragmentNodeInfo {
pub address: OpaqueNode,
pub style: Arc<ComputedValues>,
pub style: Arc<ServoComputedValues>,
pub pseudo: PseudoElementType<()>,
pub flags: InlineFragmentNodeFlags,
}

View file

@ -23,7 +23,7 @@ use inline::InlineMetrics;
use std::sync::Arc;
use style::computed_values::{list_style_type, position};
use style::logical_geometry::LogicalSize;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use text;
/// A block with the CSS `display` property equal to `list-item`.
@ -152,7 +152,7 @@ impl Flow for ListItemFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
@ -440,7 +440,7 @@ pub fn specified_border_radius(radius: BorderRadiusSize, containing_length: Au)
}
#[inline]
pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size: Au)
pub fn padding_from_style(style: &ServoComputedValues, containing_block_inline_size: Au)
-> LogicalMargin<Au> {
let padding_style = style.get_padding();
LogicalMargin::from_physical(style.writing_mode, SideOffsets2D::new(
@ -455,7 +455,7 @@ pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size:
///
/// This is used when calculating intrinsic inline sizes.
#[inline]
pub fn specified_margin_from_style(style: &ComputedValues) -> LogicalMargin<Au> {
pub fn specified_margin_from_style(style: &ServoComputedValues) -> LogicalMargin<Au> {
let margin_style = style.get_margin();
LogicalMargin::from_physical(style.writing_mode, SideOffsets2D::new(
MaybeAuto::from_style(margin_style.margin_top, Au(0)).specified_or_zero(),

View file

@ -21,7 +21,7 @@ use std::fmt;
use std::sync::Arc;
use style::context::StyleContext;
use style::logical_geometry::LogicalSize;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
use util::print_tree::PrintTree;
@ -191,7 +191,7 @@ impl Flow for MulticolFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}
@ -276,7 +276,7 @@ impl Flow for MulticolColumnFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -25,7 +25,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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use table_row::{TableRowFlow};
@ -468,7 +468,7 @@ impl Flow for TableFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -17,7 +17,7 @@ use gfx::display_list::{StackingContext, StackingContextId};
use std::fmt;
use std::sync::Arc;
use style::logical_geometry::LogicalSize;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use util::print_tree::PrintTree;
/// A table formatting context.
@ -88,7 +88,7 @@ impl Flow for TableCaptionFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -21,7 +21,7 @@ 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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use table::InternalTable;
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
use util::print_tree::PrintTree;
@ -198,7 +198,7 @@ impl Flow for TableCellFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -18,7 +18,7 @@ use std::cmp::max;
use std::fmt;
use std::sync::Arc;
use style::logical_geometry::LogicalSize;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
/// A table formatting context.
@ -101,7 +101,7 @@ impl Flow for TableColGroupFlow {
parent_id
}
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
fn repair_style(&mut self, _: &Arc<ServoComputedValues>) {}
fn compute_overflow(&self) -> Overflow {
Overflow::new()

View file

@ -25,7 +25,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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
use table_cell::{CollapsedBordersForCell, TableCellFlow};
@ -440,7 +440,7 @@ impl Flow for TableRowFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}
@ -576,7 +576,7 @@ impl CollapsedBorder {
/// Creates a collapsed border from the block-start border described in the given CSS style
/// object.
fn top(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
fn top(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_top_style,
@ -588,7 +588,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the right border described in the given CSS style
/// object.
fn right(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
fn right(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_right_style,
@ -600,7 +600,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the bottom border described in the given CSS style
/// object.
fn bottom(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
fn bottom(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_bottom_style,
@ -612,7 +612,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the left border described in the given CSS style
/// object.
fn left(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
fn left(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder {
style: css_style.get_border().border_left_style,
@ -624,7 +624,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the given physical side.
fn from_side(side: PhysicalSide,
css_style: &ComputedValues,
css_style: &ServoComputedValues,
provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
match side {
@ -637,7 +637,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the inline-start border described in the given CSS
/// style object.
pub fn inline_start(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
pub fn inline_start(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.inline_start_physical_side(),
css_style,
@ -646,7 +646,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the inline-start border described in the given CSS
/// style object.
pub fn inline_end(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
pub fn inline_end(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.inline_end_physical_side(),
css_style,
@ -655,7 +655,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the block-start border described in the given CSS
/// style object.
pub fn block_start(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
pub fn block_start(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.block_start_physical_side(),
css_style,
@ -664,7 +664,7 @@ impl CollapsedBorder {
/// Creates a collapsed border style from the block-end border described in the given CSS style
/// object.
pub fn block_end(css_style: &ComputedValues, provenance: CollapsedBorderProvenance)
pub fn block_end(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance)
-> CollapsedBorder {
CollapsedBorder::from_side(css_style.writing_mode.block_end_physical_side(),
css_style,

View file

@ -21,7 +21,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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
use table_row;
use util::print_tree::PrintTree;
@ -217,7 +217,7 @@ impl Flow for TableRowGroupFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -30,7 +30,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, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
@ -450,7 +450,7 @@ impl Flow for TableWrapperFlow {
self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
self.block_flow.repair_style(new_style)
}

View file

@ -25,7 +25,7 @@ use style::computed_values::{line_height, text_orientation, text_rendering, text
use style::computed_values::{white_space};
use style::logical_geometry::{LogicalSize, WritingMode};
use style::properties::style_structs::Font as FontStyle;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use unicode_bidi::{is_rtl, process_text};
use unicode_script::{get_script, Script};
use util::linked_list::split_off_head;
@ -414,7 +414,7 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc<Fo
}
/// Returns the line block-size needed by the given computed style and font size.
pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au {
pub fn line_height_from_style(style: &ServoComputedValues, metrics: &FontMetrics) -> Au {
let font_size = style.get_font().font_size;
match style.get_inheritedbox().line_height {
line_height::T::Normal => metrics.line_gap,

View file

@ -67,8 +67,8 @@ use style::computed_values::content::ContentItem;
use style::computed_values::{content, display};
use style::dom::{TDocument, TElement, TNode, UnsafeNode};
use style::element_state::*;
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
use style::properties::{ServoComputedValues, TComputedValues};
use style::restyle_hints::ElementSnapshot;
use style::selector_impl::{NonTSPseudoClass, PseudoElement, ServoSelectorImpl};
use style::servo::PrivateStyleData;
@ -132,7 +132,7 @@ impl<'ln> ServoLayoutNode<'ln> {
}
impl<'ln> TNode for ServoLayoutNode<'ln> {
type ConcreteComputedValues = ComputedValues;
type ConcreteComputedValues = ServoComputedValues;
type ConcreteElement = ServoLayoutElement<'ln>;
type ConcreteDocument = ServoLayoutDocument<'ln>;
type ConcreteRestyleDamage = RestyleDamage;
@ -751,7 +751,7 @@ pub trait ThreadSafeLayoutNode : Clone + Copy + Sized + PartialEq {
///
/// Unlike the version on TNode, this handles pseudo-elements.
#[inline]
fn style(&self) -> Ref<Arc<ComputedValues>> {
fn style(&self) -> Ref<Arc<ServoComputedValues>> {
Ref::map(self.borrow_layout_data().unwrap(), |data| {
let style = match self.get_pseudo_element_type() {
PseudoElementType::Before(_) => data.style_data.per_pseudo.get(&PseudoElement::Before),