mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix Servo build.
This commit is contained in:
parent
6c5456b4b6
commit
689293e4fb
12 changed files with 24 additions and 42 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1716,6 +1716,7 @@ dependencies = [
|
||||||
"canvas_traits 0.0.1",
|
"canvas_traits 0.0.1",
|
||||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx 0.0.1",
|
"gfx 0.0.1",
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1759,6 +1760,7 @@ dependencies = [
|
||||||
"embedder_traits 0.0.1",
|
"embedder_traits 0.0.1",
|
||||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx 0.0.1",
|
"gfx 0.0.1",
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"histogram 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"histogram 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -18,6 +18,7 @@ bitflags = "1.0"
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
euclid = "0.19"
|
euclid = "0.19"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
|
fxhash = "0.2"
|
||||||
gfx = {path = "../gfx"}
|
gfx = {path = "../gfx"}
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
html5ever = "0.22"
|
html5ever = "0.22"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list::items::OpaqueNode;
|
use display_list::items::OpaqueNode;
|
||||||
use flow::{Flow, GetBaseFlow};
|
use flow::{Flow, GetBaseFlow};
|
||||||
use fnv::FnvHashMap;
|
use fxhash::FxHashMap;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use opaque_node::OpaqueNodeMethods;
|
use opaque_node::OpaqueNodeMethods;
|
||||||
|
@ -26,8 +26,8 @@ use style::timer::Timer;
|
||||||
pub fn update_animation_state<E>(
|
pub fn update_animation_state<E>(
|
||||||
constellation_chan: &IpcSender<ConstellationMsg>,
|
constellation_chan: &IpcSender<ConstellationMsg>,
|
||||||
script_chan: &IpcSender<ConstellationControlMsg>,
|
script_chan: &IpcSender<ConstellationControlMsg>,
|
||||||
running_animations: &mut FnvHashMap<OpaqueNode, Vec<Animation>>,
|
running_animations: &mut FxHashMap<OpaqueNode, Vec<Animation>>,
|
||||||
expired_animations: &mut FnvHashMap<OpaqueNode, Vec<Animation>>,
|
expired_animations: &mut FxHashMap<OpaqueNode, Vec<Animation>>,
|
||||||
mut newly_transitioning_nodes: Option<&mut Vec<UntrustedNodeAddress>>,
|
mut newly_transitioning_nodes: Option<&mut Vec<UntrustedNodeAddress>>,
|
||||||
new_animations_receiver: &Receiver<Animation>,
|
new_animations_receiver: &Receiver<Animation>,
|
||||||
pipeline_id: PipelineId,
|
pipeline_id: PipelineId,
|
||||||
|
@ -153,7 +153,7 @@ where
|
||||||
pub fn recalc_style_for_animations<E>(
|
pub fn recalc_style_for_animations<E>(
|
||||||
context: &LayoutContext,
|
context: &LayoutContext,
|
||||||
flow: &mut Flow,
|
flow: &mut Flow,
|
||||||
animations: &FnvHashMap<OpaqueNode, Vec<Animation>>,
|
animations: &FxHashMap<OpaqueNode, Vec<Animation>>,
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
E: TElement,
|
E: TElement,
|
||||||
|
|
|
@ -11,6 +11,7 @@ extern crate bitflags;
|
||||||
extern crate canvas_traits;
|
extern crate canvas_traits;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
extern crate fnv;
|
extern crate fnv;
|
||||||
|
extern crate fxhash;
|
||||||
extern crate gfx;
|
extern crate gfx;
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
#[macro_use] extern crate html5ever;
|
#[macro_use] extern crate html5ever;
|
||||||
|
|
|
@ -18,6 +18,7 @@ atomic_refcell = "0.1"
|
||||||
embedder_traits = {path = "../embedder_traits"}
|
embedder_traits = {path = "../embedder_traits"}
|
||||||
euclid = "0.19"
|
euclid = "0.19"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
|
fxhash = "0.2"
|
||||||
gfx = {path = "../gfx"}
|
gfx = {path = "../gfx"}
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
histogram = "0.6.8"
|
histogram = "0.6.8"
|
||||||
|
|
|
@ -675,14 +675,6 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn first_child_element(&self) -> Option<ServoLayoutElement<'le>> {
|
|
||||||
self.as_node().dom_children().filter_map(|n| n.as_element()).next()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn last_child_element(&self) -> Option<ServoLayoutElement<'le>> {
|
|
||||||
self.as_node().rev_children().filter_map(|n| n.as_element()).next()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn prev_sibling_element(&self) -> Option<ServoLayoutElement<'le>> {
|
fn prev_sibling_element(&self) -> Option<ServoLayoutElement<'le>> {
|
||||||
let mut node = self.as_node();
|
let mut node = self.as_node();
|
||||||
while let Some(sibling) = node.prev_sibling() {
|
while let Some(sibling) = node.prev_sibling() {
|
||||||
|
@ -1223,17 +1215,6 @@ impl<'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn first_child_element(&self) -> Option<Self> {
|
|
||||||
warn!("ServoThreadSafeLayoutElement::first_child_element called");
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skips non-element nodes
|
|
||||||
fn last_child_element(&self) -> Option<Self> {
|
|
||||||
warn!("ServoThreadSafeLayoutElement::last_child_element called");
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skips non-element nodes
|
// Skips non-element nodes
|
||||||
fn prev_sibling_element(&self) -> Option<Self> {
|
fn prev_sibling_element(&self) -> Option<Self> {
|
||||||
warn!("ServoThreadSafeLayoutElement::prev_sibling_element called");
|
warn!("ServoThreadSafeLayoutElement::prev_sibling_element called");
|
||||||
|
|
|
@ -12,6 +12,7 @@ extern crate atomic_refcell;
|
||||||
extern crate embedder_traits;
|
extern crate embedder_traits;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
extern crate fnv;
|
extern crate fnv;
|
||||||
|
extern crate fxhash;
|
||||||
extern crate gfx;
|
extern crate gfx;
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
extern crate histogram;
|
extern crate histogram;
|
||||||
|
@ -59,6 +60,7 @@ use dom_wrapper::drop_style_and_layout_data;
|
||||||
use embedder_traits::resources::{self, Resource};
|
use embedder_traits::resources::{self, Resource};
|
||||||
use euclid::{Point2D, Rect, Size2D, TypedScale, TypedSize2D};
|
use euclid::{Point2D, Rect, Size2D, TypedScale, TypedSize2D};
|
||||||
use fnv::FnvHashMap;
|
use fnv::FnvHashMap;
|
||||||
|
use fxhash::FxHashMap;
|
||||||
use gfx::font;
|
use gfx::font;
|
||||||
use gfx::font_cache_thread::FontCacheThread;
|
use gfx::font_cache_thread::FontCacheThread;
|
||||||
use gfx::font_context;
|
use gfx::font_context;
|
||||||
|
@ -223,10 +225,10 @@ pub struct LayoutThread {
|
||||||
document_shared_lock: Option<SharedRwLock>,
|
document_shared_lock: Option<SharedRwLock>,
|
||||||
|
|
||||||
/// The list of currently-running animations.
|
/// The list of currently-running animations.
|
||||||
running_animations: ServoArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>,
|
running_animations: ServoArc<RwLock<FxHashMap<OpaqueNode, Vec<Animation>>>>,
|
||||||
|
|
||||||
/// The list of animations that have expired since the last style recalculation.
|
/// The list of animations that have expired since the last style recalculation.
|
||||||
expired_animations: ServoArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>,
|
expired_animations: ServoArc<RwLock<FxHashMap<OpaqueNode, Vec<Animation>>>>,
|
||||||
|
|
||||||
/// A counter for epoch messages
|
/// A counter for epoch messages
|
||||||
epoch: Cell<Epoch>,
|
epoch: Cell<Epoch>,
|
||||||
|
@ -503,7 +505,7 @@ impl LayoutThread {
|
||||||
constellation_chan: constellation_chan.clone(),
|
constellation_chan: constellation_chan.clone(),
|
||||||
time_profiler_chan: time_profiler_chan,
|
time_profiler_chan: time_profiler_chan,
|
||||||
mem_profiler_chan: mem_profiler_chan,
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
registered_painters: RegisteredPaintersImpl(FnvHashMap::default()),
|
registered_painters: RegisteredPaintersImpl(Default::default()),
|
||||||
image_cache: image_cache.clone(),
|
image_cache: image_cache.clone(),
|
||||||
font_cache_thread: font_cache_thread,
|
font_cache_thread: font_cache_thread,
|
||||||
first_reflow: Cell::new(true),
|
first_reflow: Cell::new(true),
|
||||||
|
@ -517,8 +519,8 @@ impl LayoutThread {
|
||||||
outstanding_web_fonts: Arc::new(AtomicUsize::new(0)),
|
outstanding_web_fonts: Arc::new(AtomicUsize::new(0)),
|
||||||
root_flow: RefCell::new(None),
|
root_flow: RefCell::new(None),
|
||||||
document_shared_lock: None,
|
document_shared_lock: None,
|
||||||
running_animations: ServoArc::new(RwLock::new(FnvHashMap::default())),
|
running_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||||
expired_animations: ServoArc::new(RwLock::new(FnvHashMap::default())),
|
expired_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||||
epoch: Cell::new(Epoch(0)),
|
epoch: Cell::new(Epoch(0)),
|
||||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||||
webrender_api: webrender_api_sender.create_api(),
|
webrender_api: webrender_api_sender.create_api(),
|
||||||
|
@ -1813,7 +1815,8 @@ lazy_static! {
|
||||||
struct RegisteredPainterImpl {
|
struct RegisteredPainterImpl {
|
||||||
painter: Box<Painter>,
|
painter: Box<Painter>,
|
||||||
name: Atom,
|
name: Atom,
|
||||||
properties: FnvHashMap<Atom, PropertyId>,
|
// FIXME: Should be a PrecomputedHashMap.
|
||||||
|
properties: FxHashMap<Atom, PropertyId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SpeculativePainter for RegisteredPainterImpl {
|
impl SpeculativePainter for RegisteredPainterImpl {
|
||||||
|
@ -1823,7 +1826,7 @@ impl SpeculativePainter for RegisteredPainterImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RegisteredSpeculativePainter for RegisteredPainterImpl {
|
impl RegisteredSpeculativePainter for RegisteredPainterImpl {
|
||||||
fn properties(&self) -> &FnvHashMap<Atom, PropertyId> {
|
fn properties(&self) -> &FxHashMap<Atom, PropertyId> {
|
||||||
&self.properties
|
&self.properties
|
||||||
}
|
}
|
||||||
fn name(&self) -> Atom {
|
fn name(&self) -> Atom {
|
||||||
|
|
|
@ -2640,14 +2640,6 @@ impl<'a> SelectorsElement for DomRoot<Element> {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn first_child_element(&self) -> Option<DomRoot<Element>> {
|
|
||||||
self.node.child_elements().next()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn last_child_element(&self) -> Option<DomRoot<Element>> {
|
|
||||||
self.node.rev_children().filter_map(DomRoot::downcast).next()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn prev_sibling_element(&self) -> Option<DomRoot<Element>> {
|
fn prev_sibling_element(&self) -> Option<DomRoot<Element>> {
|
||||||
self.node.preceding_siblings().filter_map(DomRoot::downcast).next()
|
self.node.preceding_siblings().filter_map(DomRoot::downcast).next()
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ extern crate string_cache;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate style_derive;
|
extern crate style_derive;
|
||||||
extern crate style_traits;
|
extern crate style_traits;
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
extern crate thin_slice;
|
extern crate thin_slice;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
extern crate uluru;
|
extern crate uluru;
|
||||||
|
|
|
@ -605,8 +605,9 @@ impl NonCustomPropertyId {
|
||||||
COLLECT_FUNCTIONS[self.0](f);
|
COLLECT_FUNCTIONS[self.0](f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Turns this `NonCustomPropertyId` into a `PropertyId`.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn to_property_id(self) -> PropertyId {
|
pub fn to_property_id(self) -> PropertyId {
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
if self.0 < ${len(data.longhands)} {
|
if self.0 < ${len(data.longhands)} {
|
||||||
return unsafe {
|
return unsafe {
|
||||||
|
@ -2412,7 +2413,7 @@ pub use gecko_properties::style_structs;
|
||||||
/// The module where all the style structs are defined.
|
/// The module where all the style structs are defined.
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
pub mod style_structs {
|
pub mod style_structs {
|
||||||
use fx::FxHasher;
|
use fxhash::FxHasher;
|
||||||
use super::longhands;
|
use super::longhands;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use logical_geometry::WritingMode;
|
use logical_geometry::WritingMode;
|
||||||
|
@ -4265,6 +4266,7 @@ pub enum AliasId {
|
||||||
|
|
||||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||||
enum AliasedPropertyId {
|
enum AliasedPropertyId {
|
||||||
|
#[allow(dead_code)] // Servo doesn't have aliased shorthands.
|
||||||
Shorthand(ShorthandId),
|
Shorthand(ShorthandId),
|
||||||
Longhand(LonghandId),
|
Longhand(LonghandId),
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ use values::generics::box_::VerticalAlign as GenericVerticalAlign;
|
||||||
use values::specified::{AllowQuirks, Number};
|
use values::specified::{AllowQuirks, Number};
|
||||||
use values::specified::length::{LengthOrPercentage, NonNegativeLength};
|
use values::specified::length::{LengthOrPercentage, NonNegativeLength};
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
|
||||||
fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool {
|
fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool {
|
||||||
use stylesheets::Origin;
|
use stylesheets::Origin;
|
||||||
context.stylesheet_origin == Origin::UserAgent ||
|
context.stylesheet_origin == Origin::UserAgent ||
|
||||||
|
|
|
@ -98,7 +98,6 @@ fn test_parse_stylesheet() {
|
||||||
}),
|
}),
|
||||||
Component::AttributeInNoNamespace {
|
Component::AttributeInNoNamespace {
|
||||||
local_name: local_name!("type"),
|
local_name: local_name!("type"),
|
||||||
local_name_lower: local_name!("type"),
|
|
||||||
operator: AttrSelectorOperator::Equal,
|
operator: AttrSelectorOperator::Equal,
|
||||||
value: "hidden".to_owned(),
|
value: "hidden".to_owned(),
|
||||||
case_sensitivity: ParsedCaseSensitivity::AsciiCaseInsensitive,
|
case_sensitivity: ParsedCaseSensitivity::AsciiCaseInsensitive,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue