Skip to content

Commit

Permalink
Renamed TComputedValues to ComputedValues
Browse files Browse the repository at this point in the history
This is a followup to #10210, and a continuation of #10185.
  • Loading branch information
perlun committed Mar 29, 2016
1 parent 639fdd6 commit 4cb4cc9
Show file tree
Hide file tree
Showing 34 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion components/gfx/display_list/mod.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style_traits::cursor::Cursor;
use text::TextRun;
use text::glyph::CharIndex;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/block.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use util::geometry::MAX_RECT;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/construct.rs
Expand Up @@ -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, ServoComputedValues, TComputedValues};
use style::properties::{self, ComputedValues, ServoComputedValues};
use table::TableFlow;
use table_caption::TableCaptionFlow;
use table_cell::TableCellFlow;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/display_list_builder.rs
Expand Up @@ -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, ServoComputedValues, TComputedValues};
use style::properties::{self, ComputedValues, ServoComputedValues};
use style::values::RGBA;
use style::values::computed;
use style::values::computed::{LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto, LinearGradient};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/flex.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;

// A mode describes which logical axis a flex axis is parallel with.
Expand Down
2 changes: 1 addition & 1 deletion components/layout/flow.rs
Expand Up @@ -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, ServoComputedValues, TComputedValues};
use style::properties::{self, ComputedValues, ServoComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow};
use table_caption::TableCaptionFlow;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/fragment.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentageOrNone};
use text;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/generated_content.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use text::TextRunScanner;
use wrapper::PseudoElementType;

Expand Down
2 changes: 1 addition & 1 deletion components/layout/incremental.rs
Expand Up @@ -7,7 +7,7 @@ use std::fmt;
use std::sync::Arc;
use style::computed_values::float;
use style::dom::TRestyleDamage;
use style::properties::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};

bitflags! {
#[doc = "Individual layout actions that may be necessary after restyling."]
Expand Down
2 changes: 1 addition & 1 deletion components/layout/inline.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::LengthOrPercentage;
use text;
use unicode_bidi;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/layout_thread.rs
Expand Up @@ -72,7 +72,7 @@ use style::error_reporting::ParseErrorReporter;
use style::logical_geometry::LogicalPoint;
use style::media_queries::{Device, MediaType};
use style::parallel::WorkQueueData;
use style::properties::TComputedValues;
use style::properties::ComputedValues;
use style::selector_impl::ServoSelectorImpl;
use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS;
use style::servo::{SharedStyleContext, Stylesheet, Stylist};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/list_item.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use text;

/// A block with the CSS `display` property equal to `list-item`.
Expand Down
2 changes: 1 addition & 1 deletion components/layout/model.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};

Expand Down
2 changes: 1 addition & 1 deletion components/layout/multicol.rs
Expand Up @@ -21,7 +21,7 @@ use std::fmt;
use std::sync::Arc;
use style::context::StyleContext;
use style::logical_geometry::LogicalSize;
use style::properties::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
use util::print_tree::PrintTree;

Expand Down
2 changes: 1 addition & 1 deletion components/layout/query.rs
Expand Up @@ -27,7 +27,7 @@ use std::sync::{Arc, Mutex};
use string_cache::Atom;
use style::computed_values;
use style::logical_geometry::{WritingMode, BlockFlowDirection, InlineBaseDirection};
use style::properties::TComputedValues;
use style::properties::ComputedValues;
use style::properties::longhands::{display, position};
use style::properties::style_structs;
use style::selector_impl::PseudoElement;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use table_row::{TableRowFlow};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_caption.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use util::print_tree::PrintTree;

/// A table formatting context.
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_cell.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use table::InternalTable;
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
use util::print_tree::PrintTree;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_colgroup.rs
Expand Up @@ -18,7 +18,7 @@ use std::cmp::max;
use std::fmt;
use std::sync::Arc;
use style::logical_geometry::LogicalSize;
use style::properties::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;

/// A table formatting context.
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_row.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
use table_cell::{CollapsedBordersForCell, TableCellFlow};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_rowgroup.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
use table_row;
use util::print_tree::PrintTree;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/table_wrapper.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
Expand Down
2 changes: 1 addition & 1 deletion components/layout/text.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use style::properties::{ComputedValues, ServoComputedValues};
use unicode_bidi::{is_rtl, process_text};
use unicode_script::{get_script, Script};
use util::linked_list::split_off_head;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/wrapper.rs
Expand Up @@ -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, ServoComputedValues};
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;
Expand Down
14 changes: 7 additions & 7 deletions components/style/animation.rs
Expand Up @@ -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::{ServoComputedValues, TComputedValues};
use properties::{ComputedValues, ServoComputedValues};
use std::cmp::Ordering;
use std::iter::repeat;
use std::sync::mpsc::Sender;
Expand Down Expand Up @@ -930,11 +930,11 @@ impl<T> GetMod for Vec<T> {
/// Inserts transitions into the queue of running animations as applicable for the given style
/// difference. This is called from the layout worker threads. Returns true if any animations were
/// kicked off and false otherwise.
pub fn start_transitions_if_applicable<C: TComputedValues>(new_animations_sender: &Mutex<Sender<Animation>>,
node: OpaqueNode,
old_style: &C,
new_style: &mut C)
-> bool {
pub fn start_transitions_if_applicable<C: ComputedValues>(new_animations_sender: &Mutex<Sender<Animation>>,
node: OpaqueNode,
old_style: &C,
new_style: &mut C)
-> bool {
let mut had_animations = false;
for i in 0..new_style.get_animation().transition_count() {
// Create any property animations, if applicable.
Expand Down Expand Up @@ -965,7 +965,7 @@ pub fn start_transitions_if_applicable<C: TComputedValues>(new_animations_sender

/// Updates a single animation and associated style based on the current time. If `damage` is
/// provided, inserts the appropriate restyle damage.
pub fn update_style_for_animation<C: TComputedValues,
pub fn update_style_for_animation<C: ComputedValues,
Damage: TRestyleDamage<ConcreteComputedValues=C>>(animation: &Animation,
style: &mut Arc<C>,
damage: Option<&mut Damage>) {
Expand Down
6 changes: 3 additions & 3 deletions components/style/context.rs
Expand Up @@ -8,7 +8,7 @@ use dom::OpaqueNode;
use error_reporting::ParseErrorReporter;
use euclid::Size2D;
use matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use properties::TComputedValues;
use properties::ComputedValues;
use selector_impl::SelectorImplExt;
use selector_matching::Stylist;
use std::cell::RefCell;
Expand Down Expand Up @@ -55,12 +55,12 @@ pub struct SharedStyleContext<Impl: SelectorImplExt> {
pub error_reporter: Box<ParseErrorReporter + Sync>,
}

pub struct LocalStyleContext<C: TComputedValues> {
pub struct LocalStyleContext<C: ComputedValues> {
pub applicable_declarations_cache: RefCell<ApplicableDeclarationsCache<C>>,
pub style_sharing_candidate_cache: RefCell<StyleSharingCandidateCache<C>>,
}

pub trait StyleContext<'a, Impl: SelectorImplExt, C: TComputedValues> {
pub trait StyleContext<'a, Impl: SelectorImplExt, C: ComputedValues> {

fn shared_context(&self) -> &'a SharedStyleContext<Impl>;
fn local_context(&self) -> &LocalStyleContext<C>;
Expand Down
6 changes: 3 additions & 3 deletions components/style/data.rs
Expand Up @@ -2,14 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use properties::TComputedValues;
use properties::ComputedValues;
use selectors::parser::SelectorImpl;
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::sync::Arc;
use std::sync::atomic::AtomicIsize;

pub struct PrivateStyleData<Impl: SelectorImpl, ConcreteComputedValues: TComputedValues> {
pub struct PrivateStyleData<Impl: SelectorImpl, ConcreteComputedValues: ComputedValues> {
/// The results of CSS styling for this node.
pub style: Option<Arc<ConcreteComputedValues>>,

Expand All @@ -22,7 +22,7 @@ pub struct PrivateStyleData<Impl: SelectorImpl, ConcreteComputedValues: TCompute
}

impl<Impl, ConcreteComputedValues> PrivateStyleData<Impl, ConcreteComputedValues>
where Impl: SelectorImpl, ConcreteComputedValues: TComputedValues {
where Impl: SelectorImpl, ConcreteComputedValues: ComputedValues {
pub fn new() -> PrivateStyleData<Impl, ConcreteComputedValues> {
PrivateStyleData {
style: None,
Expand Down
6 changes: 3 additions & 3 deletions components/style/dom.rs
Expand Up @@ -6,7 +6,7 @@

use data::PrivateStyleData;
use element_state::ElementState;
use properties::{PropertyDeclaration, PropertyDeclarationBlock, TComputedValues};
use properties::{ComputedValues, PropertyDeclaration, PropertyDeclarationBlock};
use restyle_hints::{ElementSnapshot, RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
use selector_impl::ElementExt;
use selectors::Element;
Expand Down Expand Up @@ -42,7 +42,7 @@ impl OpaqueNode {
}

pub trait TRestyleDamage : BitOr<Output=Self> + Copy {
type ConcreteComputedValues: TComputedValues;
type ConcreteComputedValues: ComputedValues;
fn compute(old: Option<&Arc<Self::ConcreteComputedValues>>, new: &Self::ConcreteComputedValues) -> Self;
fn rebuild_and_reflow() -> Self;
}
Expand All @@ -51,7 +51,7 @@ pub trait TNode : Sized + Copy + Clone {
type ConcreteElement: TElement<ConcreteNode = Self, ConcreteDocument = Self::ConcreteDocument>;
type ConcreteDocument: TDocument<ConcreteNode = Self, ConcreteElement = Self::ConcreteElement>;
type ConcreteRestyleDamage: TRestyleDamage<ConcreteComputedValues = Self::ConcreteComputedValues>;
type ConcreteComputedValues: TComputedValues;
type ConcreteComputedValues: ComputedValues;

fn to_unsafe(&self) -> UnsafeNode;
unsafe fn from_unsafe(n: &UnsafeNode) -> Self;
Expand Down
16 changes: 8 additions & 8 deletions components/style/matching.rs
Expand Up @@ -8,7 +8,7 @@ use animation::{self, Animation};
use context::SharedStyleContext;
use data::PrivateStyleData;
use dom::{TElement, TNode, TRestyleDamage};
use properties::{PropertyDeclaration, TComputedValues, cascade};
use properties::{ComputedValues, PropertyDeclaration, cascade};
use selector_impl::{ElementExt, SelectorImplExt};
use selector_matching::{DeclarationBlock, Stylist};
use selectors::Element;
Expand Down Expand Up @@ -151,11 +151,11 @@ impl<'a> Hash for ApplicableDeclarationsCacheQuery<'a> {

static APPLICABLE_DECLARATIONS_CACHE_SIZE: usize = 32;

pub struct ApplicableDeclarationsCache<C: TComputedValues> {
pub struct ApplicableDeclarationsCache<C: ComputedValues> {
cache: SimpleHashCache<ApplicableDeclarationsCacheEntry, Arc<C>>,
}

impl<C: TComputedValues> ApplicableDeclarationsCache<C> {
impl<C: ComputedValues> ApplicableDeclarationsCache<C> {
pub fn new() -> Self {
ApplicableDeclarationsCache {
cache: SimpleHashCache::new(APPLICABLE_DECLARATIONS_CACHE_SIZE),
Expand All @@ -179,12 +179,12 @@ impl<C: TComputedValues> ApplicableDeclarationsCache<C> {
}

/// An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.
pub struct StyleSharingCandidateCache<C: TComputedValues> {
pub struct StyleSharingCandidateCache<C: ComputedValues> {
cache: LRUCache<StyleSharingCandidate<C>, ()>,
}

#[derive(Clone)]
pub struct StyleSharingCandidate<C: TComputedValues> {
pub struct StyleSharingCandidate<C: ComputedValues> {
pub style: Arc<C>,
pub parent_style: Arc<C>,
pub local_name: Atom,
Expand All @@ -195,7 +195,7 @@ pub struct StyleSharingCandidate<C: TComputedValues> {
pub link: bool,
}

impl<C: TComputedValues> PartialEq for StyleSharingCandidate<C> {
impl<C: ComputedValues> PartialEq for StyleSharingCandidate<C> {
fn eq(&self, other: &Self) -> bool {
arc_ptr_eq(&self.style, &other.style) &&
arc_ptr_eq(&self.parent_style, &other.parent_style) &&
Expand All @@ -207,7 +207,7 @@ impl<C: TComputedValues> PartialEq for StyleSharingCandidate<C> {
}
}

impl<C: TComputedValues> StyleSharingCandidate<C> {
impl<C: ComputedValues> StyleSharingCandidate<C> {
/// Attempts to create a style sharing candidate from this node. Returns
/// the style sharing candidate or `None` if this node is ineligible for
/// style sharing.
Expand Down Expand Up @@ -332,7 +332,7 @@ impl<C: TComputedValues> StyleSharingCandidate<C> {

static STYLE_SHARING_CANDIDATE_CACHE_SIZE: usize = 40;

impl<C: TComputedValues> StyleSharingCandidateCache<C> {
impl<C: ComputedValues> StyleSharingCandidateCache<C> {
pub fn new() -> Self {
StyleSharingCandidateCache {
cache: LRUCache::new(STYLE_SHARING_CANDIDATE_CACHE_SIZE),
Expand Down

0 comments on commit 4cb4cc9

Please sign in to comment.