Skip to content

Commit

Permalink
servo: Merge #17775 - Replace all uses of the style::stylearc alias w…
Browse files Browse the repository at this point in the history
…ith servo_arc (from michael-p:rename-stylearc-to-servo-arc); r=emilio

The `stylearc` alias is left there temporarilly and will be removed completely in a later commit/PR where also `components/style/gecko/generated/structs_{debug|release}.rs` are re-generated (they still use the old alias).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17768  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because no new features / only refactoring

Source-Repo: https://github.com/servo/servo
Source-Revision: 31228c18499d1c7f68b6b64b559354c768e81215
  • Loading branch information
michael-p committed Jul 19, 2017
1 parent 9e00453 commit 84faeb6
Show file tree
Hide file tree
Showing 108 changed files with 150 additions and 128 deletions.
7 changes: 7 additions & 0 deletions servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions servo/components/gfx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ net_traits = {path = "../net_traits"}
ordered-float = "0.4"
range = {path = "../range"}
serde = "1.0"
servo_arc = {path = "../servo_arc"}
servo_atoms = {path = "../atoms"}
servo_geometry = {path = "../geometry"}
servo_url = {path = "../url"}
Expand Down
6 changes: 3 additions & 3 deletions servo/components/gfx/font_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use heapsize::HeapSizeOf;
use platform::font::FontHandle;
use platform::font_context::FontContextHandle;
use platform::font_template::FontTemplateData;
use servo_arc::Arc as ServoArc;
use smallvec::SmallVec;
use std::cell::RefCell;
use std::collections::HashMap;
Expand All @@ -21,7 +22,6 @@ use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use style::computed_values::{font_style, font_variant_caps};
use style::properties::style_structs;
use style::stylearc::Arc as StyleArc;
use webrender_api;

static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
Expand Down Expand Up @@ -110,7 +110,7 @@ impl FontContext {
/// Create a group of fonts for use in layout calculations. May return
/// a cached font if this font instance has already been used by
/// this context.
pub fn layout_font_group_for_style(&mut self, style: StyleArc<style_structs::Font>)
pub fn layout_font_group_for_style(&mut self, style: ServoArc<style_structs::Font>)
-> Rc<FontGroup> {
self.expire_font_caches_if_necessary();

Expand Down Expand Up @@ -240,7 +240,7 @@ impl HeapSizeOf for FontContext {

#[derive(Debug)]
struct LayoutFontGroupCacheKey {
pointer: StyleArc<style_structs::Font>,
pointer: ServoArc<style_structs::Font>,
size: Au,
}

Expand Down
1 change: 1 addition & 0 deletions servo/components/gfx/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extern crate net_traits;
extern crate ordered_float;
extern crate range;
#[macro_use] extern crate serde;
extern crate servo_arc;
extern crate servo_geometry;
extern crate servo_url;
#[macro_use] extern crate servo_atoms;
Expand Down
1 change: 1 addition & 0 deletions servo/components/layout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
selectors = { path = "../selectors" }
serde = "1.0"
servo_arc = {path = "../servo_arc"}
servo_atoms = {path = "../atoms"}
servo_geometry = {path = "../geometry"}
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ impl Flow for BlockFlow {
self.build_display_list_for_block(state, BorderPaintingMode::Separate);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.fragment.repair_style(new_style)
}

Expand Down
8 changes: 4 additions & 4 deletions servo/components/layout/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![deny(unsafe_code)]

use StyleArc;
use ServoArc;
use app_units::Au;
use block::BlockFlow;
use context::{LayoutContext, with_thread_local_font_context};
Expand Down Expand Up @@ -109,7 +109,7 @@ pub enum ConstructionItem {
/// Inline fragments and associated {ib} splits that have not yet found flows.
InlineFragments(InlineFragmentsConstructionResult),
/// Potentially ignorable whitespace.
Whitespace(OpaqueNode, PseudoElementType<()>, StyleArc<ComputedValues>, RestyleDamage),
Whitespace(OpaqueNode, PseudoElementType<()>, ServoArc<ComputedValues>, RestyleDamage),
/// TableColumn Fragment
TableColumnFragment(Fragment),
}
Expand Down Expand Up @@ -677,7 +677,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
fn create_fragments_for_node_text_content(&self,
fragments: &mut IntermediateInlineFragments,
node: &ConcreteThreadSafeLayoutNode,
style: &StyleArc<ComputedValues>) {
style: &ServoArc<ComputedValues>) {
// Fast path: If there is no text content, return immediately.
let text_content = node.text_content();
if text_content.is_empty() {
Expand Down Expand Up @@ -1806,7 +1806,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: &StyleArc<ComputedValues>) -> Option<(&'static str, &'static str)> {
fn bidi_control_chars(style: &ServoArc<ComputedValues>) -> Option<(&'static str, &'static str)> {
use style::computed_values::direction::T::*;
use style::computed_values::unicode_bidi::T::*;

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/flex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ impl Flow for FlexFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
6 changes: 3 additions & 3 deletions servo/components/layout/flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,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: &::StyleArc<ComputedValues>);
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>);

/// Print any extra children (such as fragments) contained in this Flow
/// for debugging purposes. Any items inserted into the tree will become
Expand Down Expand Up @@ -561,7 +561,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: &::StyleArc<ComputedValues>);
fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>);
}

pub trait MutableOwnedFlowUtils {
Expand Down Expand Up @@ -1381,7 +1381,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: &::StyleArc<ComputedValues>) {
fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>) {
self.repair_style(style);
mut_base(self).update_flags_if_needed(style);
self.bubble_inline_sizes();
Expand Down
14 changes: 7 additions & 7 deletions servo/components/layout/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![deny(unsafe_code)]

use StyleArc;
use ServoArc;
use app_units::Au;
use canvas_traits::CanvasMsg;
use context::{LayoutContext, with_thread_local_font_context};
Expand Down Expand Up @@ -95,10 +95,10 @@ pub struct Fragment {
pub node: OpaqueNode,

/// The CSS style of this fragment.
pub style: StyleArc<ComputedValues>,
pub style: ServoArc<ComputedValues>,

/// The CSS style of this fragment when it's selected
pub selected_style: StyleArc<ComputedValues>,
pub selected_style: ServoArc<ComputedValues>,

/// The position of this fragment relative to its owning flow. The size includes padding and
/// border, but not margin.
Expand Down Expand Up @@ -676,8 +676,8 @@ impl Fragment {
/// Constructs a new `Fragment` instance from an opaque node.
pub fn from_opaque_node_and_style(node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: StyleArc<ComputedValues>,
selected_style: StyleArc<ComputedValues>,
style: ServoArc<ComputedValues>,
selected_style: ServoArc<ComputedValues>,
mut restyle_damage: RestyleDamage,
specific: SpecificFragmentInfo)
-> Fragment {
Expand Down Expand Up @@ -706,7 +706,7 @@ impl Fragment {
/// type. For the new anonymous fragment, layout-related values (border box, etc.) are reset to
/// initial values.
pub fn create_similar_anonymous_fragment(&self,
style: StyleArc<ComputedValues>,
style: ServoArc<ComputedValues>,
specific: SpecificFragmentInfo)
-> Fragment {
let writing_mode = style.writing_mode;
Expand Down Expand Up @@ -2423,7 +2423,7 @@ impl Fragment {
}
}

pub fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) {
pub fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) {
self.style = (*new_style).clone()
}

Expand Down
4 changes: 2 additions & 2 deletions servo/components/layout/generated_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ impl Counter {
layout_context: &LayoutContext,
node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: ::StyleArc<ComputedValues>,
style: ::ServoArc<ComputedValues>,
list_style_type: list_style_type::T,
mode: RenderingMode)
-> Option<SpecificFragmentInfo> {
Expand Down Expand Up @@ -431,7 +431,7 @@ struct CounterValue {
fn render_text(layout_context: &LayoutContext,
node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: ::StyleArc<ComputedValues>,
style: ::ServoArc<ComputedValues>,
string: String)
-> Option<SpecificFragmentInfo> {
let mut fragments = LinkedList::new();
Expand Down
8 changes: 4 additions & 4 deletions servo/components/layout/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#![deny(unsafe_code)]

use StyleArc;
use ServoArc;
use app_units::{Au, MIN_AU};
use block::AbsoluteAssignBSizesTraversal;
use context::LayoutContext;
Expand Down Expand Up @@ -1665,7 +1665,7 @@ impl Flow for InlineFlow {
self.build_display_list_for_inline(state);
}

fn repair_style(&mut self, _: &StyleArc<ComputedValues>) {}
fn repair_style(&mut self, _: &ServoArc<ComputedValues>) {}

fn compute_overflow(&self) -> Overflow {
let mut overflow = Overflow::new();
Expand Down Expand Up @@ -1754,8 +1754,8 @@ impl fmt::Debug for InlineFlow {
#[derive(Clone)]
pub struct InlineFragmentNodeInfo {
pub address: OpaqueNode,
pub style: StyleArc<ComputedValues>,
pub selected_style: StyleArc<ComputedValues>,
pub style: ServoArc<ComputedValues>,
pub selected_style: ServoArc<ComputedValues>,
pub pseudo: PseudoElementType<()>,
pub flags: InlineFragmentNodeFlags,
}
Expand Down
5 changes: 3 additions & 2 deletions servo/components/layout/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern crate script_layout_interface;
extern crate script_traits;
#[macro_use] extern crate serde;
extern crate serde_json;
extern crate servo_arc;
extern crate servo_atoms;
extern crate servo_config;
extern crate servo_geometry;
Expand Down Expand Up @@ -91,6 +92,6 @@ pub use fragment::Fragment;
pub use fragment::SpecificFragmentInfo;
pub use self::data::LayoutData;

// We can't use stylearc for everything in layout, because the Flow stuff uses
// We can't use servo_arc for everything in layout, because the Flow stuff uses
// weak references.
use style::stylearc::Arc as StyleArc;
use servo_arc::Arc as ServoArc;
2 changes: 1 addition & 1 deletion servo/components/layout/list_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Flow for ListItemFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
6 changes: 3 additions & 3 deletions servo/components/layout/multicol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![deny(unsafe_code)]

use StyleArc;
use ServoArc;
use app_units::Au;
use block::BlockFlow;
use context::LayoutContext;
Expand Down Expand Up @@ -193,7 +193,7 @@ impl Flow for MulticolFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down Expand Up @@ -275,7 +275,7 @@ impl Flow for MulticolColumnFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ impl Flow for TableFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table_caption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl Flow for TableCaptionFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Flow for TableCellFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table_colgroup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Flow for TableColGroupFlow {

fn collect_stacking_contexts(&mut self, _: &mut DisplayListBuildState) {}

fn repair_style(&mut self, _: &::StyleArc<ComputedValues>) {}
fn repair_style(&mut self, _: &::ServoArc<ComputedValues>) {}

fn compute_overflow(&self) -> Overflow {
Overflow::new()
Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl Flow for TableRowFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
2 changes: 1 addition & 1 deletion servo/components/layout/table_rowgroup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl Flow for TableRowGroupFlow {
self.block_flow.collect_stacking_contexts(state);
}

fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) {
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
self.block_flow.repair_style(new_style)
}

Expand Down
Loading

0 comments on commit 84faeb6

Please sign in to comment.