Auto merge of #10210 - perlun:rename-computedvalues-to-servocomputedvalues, r=SimonSapin

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.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10210)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-29 18:25:40 +05:30
commit 639fdd6b12
28 changed files with 135 additions and 139 deletions

View file

@ -41,7 +41,7 @@ use std::ops::{Deref, DerefMut};
use std::sync::Arc;
use style::computed_values::{border_style, cursor, filter, image_rendering, mix_blend_mode};
use style::computed_values::{pointer_events};
use style::properties::{ComputedValues, TComputedValues};
use style::properties::{ServoComputedValues, TComputedValues};
use style_traits::cursor::Cursor;
use text::TextRun;
use text::glyph::CharIndex;
@ -927,7 +927,7 @@ impl DisplayItemMetadata {
/// be `PointerCursor`, but for text display items it may be `TextCursor` or
/// `VerticalTextCursor`.
#[inline]
pub fn new(node: OpaqueNode, style: &ComputedValues, default_cursor: Cursor)
pub fn new(node: OpaqueNode, style: &ServoComputedValues, default_cursor: Cursor)
-> DisplayItemMetadata {
DisplayItemMetadata {
node: node,
@ -1419,4 +1419,3 @@ impl WebRenderImageInfo {
}
}
}

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;
@ -2032,7 +2032,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)
}
@ -2954,4 +2954,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
}
@ -2104,7 +2104,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()
}
@ -2593,9 +2593,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)
@ -2692,4 +2692,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;
@ -1179,7 +1179,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.
@ -1764,7 +1764,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();
@ -1853,7 +1853,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),

View file

@ -25,7 +25,7 @@ use properties::longhands::vertical_align::computed_value::T as VerticalAlign;
use properties::longhands::visibility::computed_value::T as Visibility;
use properties::longhands::z_index::computed_value::T as ZIndex;
use properties::style_struct_traits::TAnimation;
use properties::{ComputedValues, TComputedValues};
use properties::{ServoComputedValues, TComputedValues};
use std::cmp::Ordering;
use std::iter::repeat;
use std::sync::mpsc::Sender;
@ -69,8 +69,8 @@ impl PropertyAnimation {
/// Any number of animations may be returned, from zero (if the property did not animate) to
/// one (for a single transition property) to arbitrarily many (for `all`).
pub fn from_transition(transition_index: usize,
old_style: &ComputedValues,
new_style: &mut ComputedValues)
old_style: &ServoComputedValues,
new_style: &mut ServoComputedValues)
-> Vec<PropertyAnimation> {
let mut result = Vec::new();
let transition_property =
@ -102,8 +102,8 @@ impl PropertyAnimation {
fn from_transition_property(transition_property: TransitionProperty,
transition_index: usize,
old_style: &ComputedValues,
new_style: &mut ComputedValues)
old_style: &ServoComputedValues,
new_style: &mut ServoComputedValues)
-> Option<PropertyAnimation> {
let animation_style = new_style.get_animation();
macro_rules! match_transition {
@ -197,7 +197,7 @@ impl PropertyAnimation {
}
}
pub fn update(&self, style: &mut ComputedValues, time: f64) {
pub fn update(&self, style: &mut ServoComputedValues, time: f64) {
let progress = match self.timing_function {
TransitionTimingFunction::CubicBezier(p1, p2) => {
// See `WebCore::AnimationBase::solveEpsilon(double)` in WebKit.

View file

@ -139,7 +139,7 @@ pub mod longhands {
use error_reporting::ParseErrorReporter;
use properties::longhands;
use properties::property_bit_field::PropertyBitField;
use properties::{ComputedValues, PropertyDeclaration, TComputedValues};
use properties::{ServoComputedValues, PropertyDeclaration, TComputedValues};
use properties::style_struct_traits::T${THIS_STYLE_STRUCT.name};
use properties::style_structs;
use std::collections::HashMap;
@ -6240,8 +6240,8 @@ pub trait TComputedValues : Clone + Send + Sync + 'static {
// yet - panics for non-Servo implementations.
//
// Used only for animations. Don't use it in other places.
fn as_servo<'a>(&'a self) -> &'a ComputedValues;
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues;
fn as_servo<'a>(&'a self) -> &'a ServoComputedValues;
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues;
fn new(custom_properties: Option<Arc<::custom_properties::ComputedValuesMap>>,
shareable: bool,
@ -6270,7 +6270,7 @@ pub trait TComputedValues : Clone + Send + Sync + 'static {
}
#[derive(Clone, HeapSizeOf)]
pub struct ComputedValues {
pub struct ServoComputedValues {
% for style_struct in STYLE_STRUCTS:
${style_struct.ident}: Arc<style_structs::${style_struct.name}>,
% endfor
@ -6280,13 +6280,13 @@ pub struct ComputedValues {
pub root_font_size: Au,
}
impl TComputedValues for ComputedValues {
impl TComputedValues for ServoComputedValues {
% for style_struct in STYLE_STRUCTS:
type Concrete${style_struct.name} = style_structs::${style_struct.name};
% endfor
fn as_servo<'a>(&'a self) -> &'a ComputedValues { self }
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues { self }
fn as_servo<'a>(&'a self) -> &'a ServoComputedValues { self }
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues { self }
fn new(custom_properties: Option<Arc<::custom_properties::ComputedValuesMap>>,
shareable: bool,
@ -6296,7 +6296,7 @@ impl TComputedValues for ComputedValues {
${style_struct.ident}: Arc<style_structs::${style_struct.name}>,
% endfor
) -> Self {
ComputedValues {
ServoComputedValues {
custom_properties: custom_properties,
shareable: shareable,
writing_mode: writing_mode,
@ -6345,7 +6345,7 @@ impl TComputedValues for ComputedValues {
}
}
impl ComputedValues {
impl ServoComputedValues {
/// Resolves the currentColor keyword.
/// Any color value form computed values (except for the 'color' property itself)
/// should go through this method.
@ -6565,7 +6565,7 @@ pub fn get_writing_mode<S: style_struct_traits::TInheritedBox>(inheritedbox_styl
/// The initial values for all style structs as defined by the specification.
lazy_static! {
pub static ref INITIAL_SERVO_VALUES: ComputedValues = ComputedValues {
pub static ref INITIAL_SERVO_VALUES: ServoComputedValues = ServoComputedValues {
% for style_struct in STYLE_STRUCTS:
${style_struct.ident}: Arc::new(style_structs::${style_struct.name} {
% for longhand in style_struct.longhands:
@ -6702,8 +6702,8 @@ pub type CascadePropertyFn<C: TComputedValues> =
// This is a thread-local rather than a lazy static to avoid atomic operations when cascading
// properties.
thread_local!(static CASCADE_PROPERTY: Vec<Option<CascadePropertyFn<ComputedValues>>> = {
let mut result: Vec<Option<CascadePropertyFn<ComputedValues>>> = Vec::new();
thread_local!(static CASCADE_PROPERTY: Vec<Option<CascadePropertyFn<ServoComputedValues>>> = {
let mut result: Vec<Option<CascadePropertyFn<ServoComputedValues>>> = Vec::new();
% for style_struct in STYLE_STRUCTS:
% for property in style_struct.longhands:
let discriminant;
@ -6743,8 +6743,8 @@ pub fn cascade<C: TComputedValues>(
viewport_size: Size2D<Au>,
applicable_declarations: &[DeclarationBlock<Vec<PropertyDeclaration>>],
shareable: bool,
parent_style: Option< &C >,
cached_style: Option< &C >,
parent_style: Option<<&C>,
cached_style: Option<<&C>,
mut error_reporter: Box<ParseErrorReporter + Send>)
-> (C, bool) {
use properties::style_struct_traits::{TBorder, TBox, TColor, TFont, TOutline};
@ -6942,7 +6942,7 @@ pub fn cascade<C: TComputedValues>(
///
/// FIXME(#5625, pcwalton): It would probably be cleaner and faster to do this in the cascade.
#[inline]
pub fn modify_style_for_replaced_content(style: &mut Arc<ComputedValues>) {
pub fn modify_style_for_replaced_content(style: &mut Arc<ServoComputedValues>) {
// Reset `position` to handle cases like `<div style="position: absolute">foo bar baz</div>`.
if style.box_.display != longhands::display::computed_value::T::inline {
let mut style = Arc::make_mut(style);
@ -6978,10 +6978,10 @@ pub fn modify_style_for_replaced_content(style: &mut Arc<ComputedValues>) {
/// Specifically, this function sets border widths to zero on the sides for which the fragment is
/// not outermost.
#[inline]
pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>,
pub fn modify_border_style_for_inline_sides(style: &mut Arc<ServoComputedValues>,
is_first_fragment_of_element: bool,
is_last_fragment_of_element: bool) {
fn modify_side(style: &mut Arc<ComputedValues>, side: PhysicalSide) {
fn modify_side(style: &mut Arc<ServoComputedValues>, side: PhysicalSide) {
let mut style = Arc::make_mut(style);
let border = Arc::make_mut(&mut style.border);
match side {
@ -7018,7 +7018,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>,
/// Adjusts the display and position properties as appropriate for an anonymous table object.
#[inline]
pub fn modify_style_for_anonymous_table_object(
style: &mut Arc<ComputedValues>,
style: &mut Arc<ServoComputedValues>,
new_display_value: longhands::display::computed_value::T) {
let mut style = Arc::make_mut(style);
let box_style = Arc::make_mut(&mut style.box_);
@ -7028,7 +7028,7 @@ pub fn modify_style_for_anonymous_table_object(
/// Adjusts the `position` property as necessary for the outer fragment wrapper of an inline-block.
#[inline]
pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc<ComputedValues>) {
pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc<ServoComputedValues>) {
let mut style = Arc::make_mut(style);
let box_style = Arc::make_mut(&mut style.box_);
box_style.position = longhands::position::computed_value::T::static_
@ -7039,7 +7039,7 @@ pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc<ComputedValu
/// Text is never directly relatively positioned; it's always contained within an element that is
/// itself relatively positioned.
#[inline]
pub fn modify_style_for_text(style: &mut Arc<ComputedValues>) {
pub fn modify_style_for_text(style: &mut Arc<ServoComputedValues>) {
if style.box_.position == longhands::position::computed_value::T::relative {
// We leave the `position` property set to `relative` so that we'll still establish a
// containing block if needed. But we reset all position offsets to `auto`.
@ -7074,7 +7074,7 @@ pub fn modify_style_for_text(style: &mut Arc<ComputedValues>) {
///
/// Margins apply to the `input` element itself, so including them in the text will cause them to
/// be double-counted.
pub fn modify_style_for_input_text(style: &mut Arc<ComputedValues>) {
pub fn modify_style_for_input_text(style: &mut Arc<ServoComputedValues>) {
let mut style = Arc::make_mut(style);
let margin_style = Arc::make_mut(&mut style.margin);
margin_style.margin_top = computed::LengthOrPercentageOrAuto::Length(Au(0));
@ -7089,7 +7089,7 @@ pub fn modify_style_for_input_text(style: &mut Arc<ComputedValues>) {
/// Adjusts the `clip` property so that an inline absolute hypothetical fragment doesn't clip its
/// children.
pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc<ComputedValues>) {
pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc<ServoComputedValues>) {
if style.get_effects().clip.0.is_some() {
let mut style = Arc::make_mut(style);
let effects_style = Arc::make_mut(&mut style.effects);

View file

@ -3,14 +3,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use context;
use data;
use properties::ComputedValues;
use properties::ServoComputedValues;
use selector_impl::ServoSelectorImpl;
use selector_matching;
use stylesheets;
/// Concrete types for servo Style implementation
pub type Stylesheet = stylesheets::Stylesheet<ServoSelectorImpl>;
pub type PrivateStyleData = data::PrivateStyleData<ServoSelectorImpl, ComputedValues>;
pub type PrivateStyleData = data::PrivateStyleData<ServoSelectorImpl, ServoComputedValues>;
pub type Stylist = selector_matching::Stylist<ServoSelectorImpl>;
pub type StylistWrapper = context::StylistWrapper<ServoSelectorImpl>;
pub type SharedStyleContext = context::SharedStyleContext<ServoSelectorImpl>;

View file

@ -8,7 +8,7 @@ use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser,
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
use parser::{ParserContext, log_css_error};
use properties::{ComputedValues, TComputedValues};
use properties::{ServoComputedValues, TComputedValues};
use std::ascii::AsciiExt;
use std::collections::hash_map::{Entry, HashMap};
use std::fmt;
@ -594,8 +594,8 @@ impl MaybeNew for ViewportConstraints {
let context = Context {
is_root_element: false,
viewport_size: initial_viewport,
inherited_style: ComputedValues::initial_values(),
style: ComputedValues::initial_values().clone(),
inherited_style: ServoComputedValues::initial_values(),
style: ServoComputedValues::initial_values().clone(),
};
// DEVICE-ADAPT § 9.3 Resolving 'extend-to-zoom'

View file

@ -6,7 +6,7 @@ use app_units::Au;
use std::sync::Arc;
use style::custom_properties::ComputedValuesMap;
use style::logical_geometry::WritingMode;
use style::properties::{CascadePropertyFn, ComputedValues, TComputedValues};
use style::properties::{CascadePropertyFn, ServoComputedValues, TComputedValues};
use style::properties::longhands;
use style::properties::style_struct_traits::*;
@ -28,8 +28,8 @@ impl TComputedValues for GeckoComputedValues {
% endfor
// These will go away, and we will never implement them.
fn as_servo<'a>(&'a self) -> &'a ComputedValues { unimplemented!() }
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues { unimplemented!() }
fn as_servo<'a>(&'a self) -> &'a ServoComputedValues { unimplemented!() }
fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues { unimplemented!() }
fn new(custom_properties: Option<Arc<ComputedValuesMap>>,
shareable: bool,