diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-04 12:57:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-04 12:57:00 -0700 |
commit | 3b0dadda529a5ba45a8a0dc394187f43a66e7c1f (patch) | |
tree | 051be23bf32b15dd64e65658052ccb8d962834bb | |
parent | 80cb0cf8214fd52d2884724614c40cb278ee7575 (diff) | |
parent | bf34fdde1fbee49bf518ef0dcbb40447fc35fe0f (diff) | |
download | servo-3b0dadda529a5ba45a8a0dc394187f43a66e7c1f.tar.gz servo-3b0dadda529a5ba45a8a0dc394187f43a66e7c1f.zip |
Auto merge of #12224 - nox:die-util-die, r=Ms2ger
Remove some stuff from util
<!-- 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/12224)
<!-- Reviewable:end -->
40 files changed, 120 insertions, 184 deletions
diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index 1faf41a9aed..c69b2039c44 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -19,7 +19,6 @@ use std::borrow::ToOwned; use std::mem; use util::opts; use util::thread::spawn_named; -use util::vec::byte_swap; use webrender_traits; impl<'a> CanvasPaintThread<'a> { diff --git a/components/canvas/webgl_paint_thread.rs b/components/canvas/webgl_paint_thread.rs index a9fe55a848a..2c77f63b82b 100644 --- a/components/canvas/webgl_paint_thread.rs +++ b/components/canvas/webgl_paint_thread.rs @@ -2,7 +2,8 @@ * 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 canvas_traits::{CanvasCommonMsg, CanvasMsg, CanvasPixelData, CanvasData, FromLayoutMsg}; +use canvas_traits::{CanvasCommonMsg, CanvasData, CanvasMsg, CanvasPixelData}; +use canvas_traits::{FromLayoutMsg, byte_swap}; use euclid::size::Size2D; use gleam::gl; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; @@ -10,7 +11,6 @@ use offscreen_gl_context::{ColorAttachmentType, GLContext, GLLimits, GLContextAt use std::borrow::ToOwned; use std::sync::mpsc::channel; use util::thread::spawn_named; -use util::vec::byte_swap; use webrender_traits; enum WebGLPaintTaskData { diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index 98eaa159077..db945750a0c 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -539,3 +539,16 @@ impl ToAzColor for RGBA { self.alpha as AzFloat) } } + +// TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this. +pub fn byte_swap(data: &mut [u8]) { + let length = data.len(); + // FIXME(rust #27741): Range::step_by is not stable yet as of this writing. + let mut i = 0; + while i < length { + let r = data[i + 2]; + data[i + 2] = data[i + 0]; + data[i + 0] = r; + i += 4; + } +} diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index b77847eb1c8..9e540b7d7af 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -14,6 +14,7 @@ use euclid::rect::TypedRect; use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use euclid::{Matrix4D, Point2D, Rect, Size2D}; +use gfx_traits::print_tree::PrintTree; use gfx_traits::{ChromeToPaintMsg, PaintRequest, ScrollPolicy, StackingContextId}; use gfx_traits::{color, Epoch, FrameTreeId, FragmentType, LayerId, LayerKind, LayerProperties}; use gleam::gl; @@ -51,7 +52,6 @@ use url::Url; use util::geometry::{PagePx, ScreenPx, ViewportPx}; use util::opts; use util::prefs::PREFS; -use util::print_tree::PrintTree; use webrender; use webrender_traits::{self, ScrollEventPhase}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 25b7c46075f..3eed504303b 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -23,6 +23,7 @@ use euclid::rect::TypedRect; use euclid::side_offsets::SideOffsets2D; use euclid::{Matrix2D, Matrix4D, Point2D, Rect, Size2D}; use fnv::FnvHasher; +use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, ScrollPolicy, StackingContextId}; use ipc_channel::ipc::IpcSharedMemory; use msg::constellation_msg::PipelineId; @@ -45,7 +46,6 @@ use style_traits::cursor::Cursor; use text::TextRun; use text::glyph::ByteIndex; use util::geometry::{self, MAX_RECT, ScreenPx}; -use util::print_tree::PrintTree; use webrender_traits::{self, WebGLContextId}; pub use style::dom::OpaqueNode; diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index 9d01f883389..8b34d1b3b78 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -23,6 +23,7 @@ extern crate serde; pub mod color; mod paint_listener; +pub mod print_tree; pub use paint_listener::PaintListener; use azure::azure_hl::Color; diff --git a/components/util/print_tree.rs b/components/gfx_traits/print_tree.rs index 7a6ac4f0be9..7a6ac4f0be9 100644 --- a/components/util/print_tree.rs +++ b/components/gfx_traits/print_tree.rs diff --git a/components/layout/block.rs b/components/layout/block.rs index ab810c59521..41d382f3004 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -44,6 +44,7 @@ use flow_ref::FlowRef; use fragment::SpecificFragmentInfo; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER, Overflow}; use gfx::display_list::{ClippingRegion, StackingContext}; +use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, StackingContextId}; use layout_debug; use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none}; @@ -62,7 +63,6 @@ use style::servo::SharedStyleContext; use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use util::geometry::MAX_RECT; -use util::print_tree::PrintTree; /// The number of screens of data we're allowed to generate display lists for in each direction. const DISPLAY_PORT_SIZE_FACTOR: i32 = 8; diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 73277288e3b..1c53740c402 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -35,6 +35,7 @@ use flow_list::{FlowList, FlowListIterator, MutFlowListIterator}; use flow_ref::{self, FlowRef, WeakFlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo}; use gfx::display_list::{ClippingRegion, StackingContext}; +use gfx_traits::print_tree::PrintTree; use gfx_traits::{LayerId, LayerType, StackingContextId}; use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; @@ -61,7 +62,6 @@ use table_colgroup::TableColGroupFlow; use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; -use util::print_tree::PrintTree; /// Virtual methods that make up a float context. /// diff --git a/components/layout/inline.rs b/components/layout/inline.rs index af1f6c878cd..6195024f2ca 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -21,6 +21,7 @@ use gfx::display_list::{OpaqueNode, StackingContext}; use gfx::font::FontMetrics; use gfx::font_context::FontContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use layout_debug; use model::IntrinsicISizesContribution; use range::{Range, RangeIndex}; @@ -41,7 +42,6 @@ use style::values::computed::LengthOrPercentage; use text; use unicode_bidi; use util; -use util::print_tree::PrintTree; // From gfxFontConstants.h in Firefox static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20; diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index e8e974ec5a2..e2bb1a66f79 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -17,6 +17,7 @@ use flow_ref::{self, FlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use std::cmp::{min, max}; use std::fmt; use std::sync::Arc; @@ -25,7 +26,6 @@ use style::logical_geometry::LogicalSize; use style::properties::{ComputedValues, ServoComputedValues}; use style::servo::SharedStyleContext; use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; -use util::print_tree::PrintTree; pub struct MulticolFlow { pub block_flow: BlockFlow, diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index ba23c0d7061..9e1009ce835 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -17,10 +17,10 @@ use std::sync::atomic::{AtomicIsize, Ordering}; use style::dom::UnsafeNode; use style::parallel::run_queue_with_custom_work_data_type; use style::parallel::{CHUNK_SIZE, WorkQueueData}; +use style::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; use traversal::AssignBSizes; use traversal::{AssignISizes, BubbleISizes}; use util::opts; -use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; pub use style::parallel::traverse_dom; diff --git a/components/layout/table.rs b/components/layout/table.rs index 0299d9b9b01..4f41cdb681f 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -18,6 +18,7 @@ use flow_list::MutFlowListIterator; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use layout_debug; use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto}; use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW}; @@ -33,7 +34,6 @@ use style::values::computed::LengthOrPercentageOrAuto; use table_row::TableRowFlow; use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance}; use table_wrapper::TableLayout; -use util::print_tree::PrintTree; /// A table flow corresponded to the table's internal table fragment under a table wrapper flow. /// The properties `position`, `float`, and `margin-*` are used on the table wrapper fragment, diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index ad7c43d3f99..aaa038a4b57 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -15,12 +15,12 @@ use flow::{Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use std::fmt; use std::sync::Arc; use style::logical_geometry::LogicalSize; use style::properties::ServoComputedValues; use style::servo::SharedStyleContext; -use util::print_tree::PrintTree; /// A table formatting context. pub struct TableCaptionFlow { diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 8b6db89ff38..58bb96cfbf6 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -16,6 +16,7 @@ use flow::{self, Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use layout_debug; use model::MaybeAuto; use script_layout_interface::restyle_damage::REFLOW; @@ -28,7 +29,6 @@ use style::properties::{ComputedValues, ServoComputedValues}; use style::servo::SharedStyleContext; use table::InternalTable; use table_row::{CollapsedBorder, CollapsedBorderProvenance}; -use util::print_tree::PrintTree; /// A table formatting context. #[derive(RustcEncodable)] diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index b8835d493ef..0406b7a806b 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -17,6 +17,7 @@ use flow_list::MutFlowListIterator; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use layout_debug; use model::MaybeAuto; use rustc_serialize::{Encodable, Encoder}; @@ -31,7 +32,6 @@ use style::servo::SharedStyleContext; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; -use util::print_tree::PrintTree; /// A single row of a table. pub struct TableRowFlow { diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index 91dcb0f00a2..21d6a00cb74 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -15,6 +15,7 @@ use flow::{Flow, FlowClass, OpaqueFlow}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use layout_debug; use rustc_serialize::{Encodable, Encoder}; use std::fmt; @@ -26,7 +27,6 @@ use style::properties::{ComputedValues, ServoComputedValues}; use style::servo::SharedStyleContext; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; use table_row; -use util::print_tree::PrintTree; /// A table formatting context. pub struct TableRowGroupFlow { diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index c331cd9ee2a..b88819274e1 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -24,6 +24,7 @@ use flow::{Flow, FlowClass, ImmutableFlowUtils, INLINE_POSITION_IS_STATIC, Opaqu use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::StackingContext; use gfx_traits::StackingContextId; +use gfx_traits::print_tree::PrintTree; use model::MaybeAuto; use std::cmp::{max, min}; use std::fmt; @@ -37,7 +38,6 @@ use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; use table_row; -use util::print_tree::PrintTree; #[derive(Copy, Clone, RustcEncodable, Debug)] pub enum TableLayout { diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index bcb0373ab20..fe1f82f533b 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -110,13 +110,13 @@ use style::refcell::RefCell; use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS; use style::servo::{Animation, LocalStyleContextCreationInfo, SharedStyleContext, Stylesheet, Stylist}; use style::stylesheets::CSSRuleIteratorExt; +use style::workqueue::WorkQueue; use url::Url; use util::geometry::MAX_RECT; use util::ipc::OptionalIpcSender; use util::opts; use util::thread; use util::thread_state; -use util::workqueue::WorkQueue; /// The number of screens we have to traverse before we decide to generate new display lists. const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4; diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index fc6afdc2b25..1c6f83651d1 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -3,8 +3,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg}; -use canvas_traits::{CompositionOrBlending, LineCapStyle, LineJoinStyle}; -use canvas_traits::{FillOrStrokeStyle, FillRule, LinearGradientStyle, RadialGradientStyle, RepetitionStyle}; +use canvas_traits::{CompositionOrBlending, FillOrStrokeStyle, FillRule}; +use canvas_traits::{LineCapStyle, LineJoinStyle, LinearGradientStyle}; +use canvas_traits::{RadialGradientStyle, RepetitionStyle, byte_swap}; use cssparser::Color as CSSColor; use cssparser::{Parser, RGBA}; use dom::bindings::cell::DOMRefCell; @@ -46,7 +47,6 @@ use std::str::FromStr; use std::{cmp, fmt}; use unpremultiplytable::UNPREMULTIPLY_TABLE; use url::Url; -use util::vec::byte_swap; #[must_root] #[derive(JSTraceable, Clone, HeapSizeOf)] diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 479a73dee86..d9535663d46 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -75,7 +75,6 @@ use selectors::matching::{DeclarationBlock, ElementFlags, matches}; use selectors::matching::{HAS_SLOW_SELECTOR, HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; use selectors::parser::{AttrSelector, NamespaceConstraint, parse_author_origin_selector_list_from_str}; -use smallvec::VecLike; use std::ascii::AsciiExt; use std::borrow::Cow; use std::cell::{Cell, Ref}; @@ -91,6 +90,7 @@ use style::properties::DeclaredValue; use style::properties::longhands::{self, background_image, border_spacing, font_family, overflow_x, font_size}; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute}; use style::selector_impl::{NonTSPseudoClass, ServoSelectorImpl}; +use style::sink::Push; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA, LengthOrPercentage}; @@ -275,7 +275,7 @@ pub trait LayoutElementHelpers { #[allow(unsafe_code)] unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>; + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>>; #[allow(unsafe_code)] unsafe fn get_colspan(self) -> u32; #[allow(unsafe_code)] @@ -308,7 +308,7 @@ impl LayoutElementHelpers for LayoutJS<Element> { #[allow(unsafe_code)] unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, hints: &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>> { #[inline] fn from_declaration(rule: PropertyDeclaration) -> DeclarationBlock<Vec<PropertyDeclaration>> { diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index cf814068b22..dbb774ad87b 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -2,7 +2,7 @@ * 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 canvas_traits::{CanvasCommonMsg, CanvasMsg}; +use canvas_traits::{CanvasCommonMsg, CanvasMsg, byte_swap}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes}; @@ -40,7 +40,6 @@ use net_traits::image_cache_thread::ImageResponse; use offscreen_gl_context::{GLContextAttributes, GLLimits}; use script_traits::ScriptMsg as ConstellationMsg; use std::cell::Cell; -use util::vec::byte_swap; use webrender_traits::WebGLError::*; use webrender_traits::{WebGLCommand, WebGLError, WebGLFramebufferBindingRequest, WebGLParameter}; diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 681fdab9c46..779c37a5d52 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -49,7 +49,6 @@ use script_layout_interface::{HTMLCanvasData, LayoutNodeType, TrustedNodeAddress use script_layout_interface::{OpaqueStyleAndLayoutData, PartialStyleAndLayoutData}; use selectors::matching::{DeclarationBlock, ElementFlags}; use selectors::parser::{AttrSelector, NamespaceConstraint}; -use smallvec::VecLike; use std::marker::PhantomData; use std::mem::{transmute, transmute_copy}; use string_cache::{Atom, BorrowedAtom, BorrowedNamespace, Namespace}; @@ -63,6 +62,7 @@ use style::refcell::{Ref, RefCell, RefMut}; use style::restyle_hints::ElementSnapshot; use style::selector_impl::{NonTSPseudoClass, ServoSelectorImpl}; use style::servo::{PrivateStyleData, SharedStyleContext}; +use style::sink::Push; use url::Url; use util::str::is_whitespace; @@ -360,7 +360,7 @@ pub struct ServoLayoutElement<'le> { impl<'le> PresentationalHintsSynthetizer for ServoLayoutElement<'le> { fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, hints: &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>> { unsafe { self.element.synthesize_presentational_hints_for_legacy_attributes(hints); @@ -995,5 +995,5 @@ impl <'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> { impl<'le> PresentationalHintsSynthetizer for ServoThreadSafeLayoutElement<'le> { fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, _hints: &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> {} + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>> {} } diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index b20bbe079fe..98ff10d0483 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -2231,15 +2231,19 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2457,14 +2461,11 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", - "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2472,7 +2473,6 @@ dependencies = [ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 37a4bf6bb01..a90673b9e40 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -22,6 +22,7 @@ servo = ["serde", "serde/nightly", "serde_macros", "heapsize", "heapsize_plugin" app_units = "0.2.5" bitflags = "0.7" cssparser = "0.5.5" +deque = "0.3.1" encoding = "0.2" euclid = "0.7.1" fnv = "1.0" @@ -29,9 +30,11 @@ gecko_bindings = {path = "../../ports/geckolib/gecko_bindings", optional = true} heapsize = {version = "0.3.0", optional = true} heapsize_plugin = {version = "0.1.2", optional = true} lazy_static = "0.2" +libc = "0.2" log = "0.3.5" matches = "0.1" num-traits = "0.1.32" +rand = "0.3" rustc-serialize = "0.3" selectors = "0.6" serde = {version = "0.7.11", optional = true} @@ -43,5 +46,8 @@ time = "0.1" url = "1.0.0" util = {path = "../util"} +[target.'cfg(windows)'.dependencies] +kernel32-sys = "0.2" + [build-dependencies] walkdir = "0.1" diff --git a/components/style/dom.rs b/components/style/dom.rs index 4f7eeaff169..11cc5f93a0e 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -15,7 +15,7 @@ use restyle_hints::{ElementSnapshot, RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS use selector_impl::{ElementExt, SelectorImplExt}; use selectors::Element; use selectors::matching::DeclarationBlock; -use smallvec::VecLike; +use sink::Push; use std::ops::BitOr; use std::sync::Arc; use string_cache::{Atom, Namespace}; @@ -194,7 +194,7 @@ pub trait TDocument : Sized + Copy + Clone { pub trait PresentationalHintsSynthetizer { fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, hints: &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>; + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>>; } pub trait TElement : Sized + Copy + Clone + ElementExt + PresentationalHintsSynthetizer { diff --git a/components/style/lib.rs b/components/style/lib.rs index ae1e8c84d7c..325c89fdd46 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -40,6 +40,7 @@ extern crate bitflags; extern crate core; #[macro_use] extern crate cssparser; +extern crate deque; extern crate encoding; extern crate euclid; extern crate fnv; @@ -49,12 +50,14 @@ extern crate gecko_bindings; #[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static; +extern crate libc; #[macro_use] extern crate log; #[allow(unused_extern_crates)] #[macro_use] extern crate matches; extern crate num_traits; +extern crate rand; extern crate rustc_serialize; extern crate selectors; #[cfg(feature = "servo")] extern crate serde; @@ -88,12 +91,14 @@ pub mod selector_impl; pub mod selector_matching; pub mod sequential; pub mod servo; +pub mod sink; pub mod stylesheets; pub mod traversal; #[macro_use] #[allow(non_camel_case_types)] pub mod values; pub mod viewport; +pub mod workqueue; /// The CSS properties supported by the style system. // Generated from the properties.mako.rs template by build.rs diff --git a/components/style/matching.rs b/components/style/matching.rs index 7f865cf9a72..d3dd3742d3d 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -17,6 +17,7 @@ use selectors::Element; use selectors::bloom::BloomFilter; use selectors::matching::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes}; use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; +use sink::ForgetfulSink; use smallvec::SmallVec; use std::collections::HashMap; use std::hash::{BuildHasherDefault, Hash, Hasher}; @@ -26,7 +27,6 @@ use string_cache::{Atom, Namespace}; use util::arc_ptr_eq; use util::cache::{LRUCache, SimpleHashCache}; use util::opts; -use util::vec::ForgetfulSink; fn create_common_style_affecting_attributes_from_element<E: TElement>(element: &E) -> CommonStyleAffectingAttributes { diff --git a/components/style/parallel.rs b/components/style/parallel.rs index d7cb95ecac2..0bc840f7492 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -12,7 +12,7 @@ use dom::{OpaqueNode, TNode, UnsafeNode}; use std::mem; use std::sync::atomic::Ordering; use traversal::DomTraversalContext; -use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; +use workqueue::{WorkQueue, WorkUnit, WorkerProxy}; #[allow(dead_code)] fn static_assertion(node: UnsafeNode) { diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index 35a38d5ed14..74718d4b69b 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -18,6 +18,7 @@ use selectors::bloom::BloomFilter; use selectors::matching::DeclarationBlock as GenericDeclarationBlock; use selectors::matching::{Rule, SelectorMap}; use selectors::parser::SelectorImpl; +use sink::Push; use smallvec::VecLike; use std::collections::HashMap; use std::hash::BuildHasherDefault; @@ -389,7 +390,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> { applicable_declarations: &mut V) -> bool where E: Element<Impl=Impl> + PresentationalHintsSynthetizer, - V: VecLike<DeclarationBlock> { + V: Push<DeclarationBlock> + VecLike<DeclarationBlock> { assert!(!self.is_device_dirty); assert!(style_attribute.is_none() || pseudo_element.is_none(), "Style attributes do not apply to pseudo-elements"); @@ -430,7 +431,8 @@ impl<Impl: SelectorImplExt> Stylist<Impl> { // Step 4: Normal style attributes. style_attribute.map(|sa| { shareable = false; - applicable_declarations.push( + Push::push( + applicable_declarations, GenericDeclarationBlock::from_declarations(sa.normal.clone())) }); @@ -443,7 +445,8 @@ impl<Impl: SelectorImplExt> Stylist<Impl> { // Step 6: `!important` style attributes. style_attribute.map(|sa| { shareable = false; - applicable_declarations.push( + Push::push( + applicable_declarations, GenericDeclarationBlock::from_declarations(sa.important.clone())) }); diff --git a/components/style/sink.rs b/components/style/sink.rs new file mode 100644 index 00000000000..33aa26ac1af --- /dev/null +++ b/components/style/sink.rs @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 smallvec::{Array, SmallVec}; +use std::marker::PhantomData; + +pub trait Push<T> { + fn push(&mut self, value: T); +} + +impl<T> Push<T> for Vec<T> { + fn push(&mut self, value: T) { + Vec::push(self, value); + } +} + +impl<A: Array> Push<A::Item> for SmallVec<A> { + fn push(&mut self, value: A::Item) { + SmallVec::push(self, value); + } +} + +pub struct ForgetfulSink<T>(bool, PhantomData<T>); + +impl<T> ForgetfulSink<T> { + pub fn new() -> Self { + ForgetfulSink(true, PhantomData) + } + + pub fn is_empty(&self) -> bool { + self.0 + } +} + +impl<T> Push<T> for ForgetfulSink<T> { + fn push(&mut self, _value: T) { + self.0 = false; + } +} diff --git a/components/util/workqueue.rs b/components/style/workqueue.rs index ebc85df466f..acee9faf5f8 100644 --- a/components/util/workqueue.rs +++ b/components/style/workqueue.rs @@ -7,6 +7,8 @@ //! Data associated with queues is simply a pair of unsigned integers. It is expected that a //! higher-level API on top of this could allow safe fork-join parallelism. +#![allow(unsafe_code)] + #[cfg(windows)] extern crate kernel32; @@ -16,8 +18,8 @@ use libc::usleep; use rand::{Rng, XorShiftRng, weak_rng}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{Receiver, Sender, channel}; -use thread::spawn_named; -use thread_state; +use util::thread::spawn_named; +use util::thread_state; /// A unit of work. /// diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index 83b23c78c87..8f8b26bcae2 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -17,13 +17,11 @@ servo = ["serde", "serde_macros", "backtrace", "ipc-channel", "app_units/plugins app_units = "0.2.5" backtrace = {version = "0.2.1", optional = true} bitflags = "0.7" -deque = "0.3.1" euclid = "0.7.1" getopts = "0.2.11" heapsize = "0.3.0" ipc-channel = {git = "https://github.com/servo/ipc-channel", optional = true} lazy_static = "0.2" -libc = "0.2" log = "0.3.5" num_cpus = "0.2.2" num-traits = "0.1.32" @@ -31,11 +29,7 @@ rand = "0.3" rustc-serialize = "0.3" serde = {version = "0.7.11", optional = true} serde_macros = {version = "0.7.11", optional = true} -smallvec = "0.1" url = "1.0.0" [target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies] xdg = "2.0" - -[target.'cfg(windows)'.dependencies] -kernel32-sys = "0.2" diff --git a/components/util/debug_utils.rs b/components/util/debug_utils.rs deleted file mode 100644 index 631c7dad4ca..00000000000 --- a/components/util/debug_utils.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 std::io::{self, Write}; -use std::mem; -use std::mem::size_of; -use std::slice; - -fn hexdump_slice(buf: &[u8]) { - let mut stderr = io::stderr(); - stderr.write_all(b" ").unwrap(); - for (i, &v) in buf.iter().enumerate() { - let output = format!("{:02X} ", v); - stderr.write_all(output.as_bytes()).unwrap(); - match i % 16 { - 15 => { stderr.write_all(b"\n ").unwrap(); }, - 7 => { stderr.write_all(b" ").unwrap(); }, - _ => () - } - stderr.flush().unwrap(); - } - stderr.write_all(b"\n").unwrap(); -} - -pub fn hexdump<T>(obj: &T) { - unsafe { - let buf: *const u8 = mem::transmute(obj); - debug!("dumping at {:p}", buf); - let from_buf = slice::from_raw_parts(buf, size_of::<T>()); - hexdump_slice(from_buf); - } -} diff --git a/components/util/lib.rs b/components/util/lib.rs index 84c86a982ed..fed8c9b0178 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -14,20 +14,17 @@ extern crate app_units; #[cfg(feature = "servo")] extern crate backtrace; #[allow(unused_extern_crates)] #[macro_use] extern crate bitflags; -extern crate deque; extern crate euclid; extern crate getopts; #[macro_use] extern crate heapsize; #[cfg(feature = "servo")] extern crate ipc_channel; #[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static; -extern crate libc; #[macro_use] extern crate log; extern crate num_cpus; extern crate num_traits; extern crate rand; extern crate rustc_serialize; #[cfg(feature = "servo")] extern crate serde; -extern crate smallvec; extern crate url; #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] extern crate xdg; @@ -36,20 +33,16 @@ use std::sync::Arc; pub mod basedir; pub mod cache; -#[allow(unsafe_code)] pub mod debug_utils; pub mod geometry; #[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod ipc; #[allow(unsafe_code)] pub mod opts; #[cfg(feature = "servo")] pub mod panicking; pub mod prefs; -#[cfg(feature = "servo")] pub mod print_tree; pub mod resource_files; pub mod str; pub mod thread; pub mod thread_state; pub mod tid; -pub mod vec; -#[allow(unsafe_code)] pub mod workqueue; #[cfg(feature = "servo")] #[allow(unsafe_code)] diff --git a/components/util/vec.rs b/components/util/vec.rs deleted file mode 100644 index 639e1c260da..00000000000 --- a/components/util/vec.rs +++ /dev/null @@ -1,87 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 std::marker::PhantomData; -use std::ops; -use super::smallvec::VecLike; - -// TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this. -pub fn byte_swap(data: &mut [u8]) { - let length = data.len(); - // FIXME(rust #27741): Range::step_by is not stable yet as of this writing. - let mut i = 0; - while i < length { - let r = data[i + 2]; - data[i + 2] = data[i + 0]; - data[i + 0] = r; - i += 4; - } -} - -/// A `VecLike` that only tracks whether or not something was ever pushed to it. -pub struct ForgetfulSink<T> { - empty: bool, - _data: PhantomData<T>, -} - -impl<T> ForgetfulSink<T> { - pub fn new() -> ForgetfulSink<T> { - ForgetfulSink { - empty: true, - _data: PhantomData, - } - } - - pub fn is_empty(&self) -> bool { - self.empty - } -} - -impl<T> ops::Deref for ForgetfulSink<T> { - type Target = [T]; - fn deref(&self) -> &[T] { - unreachable!() - } -} - -impl<T> ops::DerefMut for ForgetfulSink<T> { - fn deref_mut(&mut self) -> &mut [T] { - unreachable!() - } -} - -macro_rules! impl_index { - ($index_type: ty, $output_type: ty) => { - impl<T> ops::Index<$index_type> for ForgetfulSink<T> { - type Output = $output_type; - fn index(&self, _index: $index_type) -> &$output_type { - unreachable!() - } - } - - impl<T> ops::IndexMut<$index_type> for ForgetfulSink<T> { - fn index_mut(&mut self, _index: $index_type) -> &mut $output_type { - unreachable!() - } - } - } -} - -impl_index!(usize, T); -impl_index!(ops::Range<usize>, [T]); -impl_index!(ops::RangeFrom<usize>, [T]); -impl_index!(ops::RangeTo<usize>, [T]); -impl_index!(ops::RangeFull, [T]); - -impl<T> VecLike<T> for ForgetfulSink<T> { - #[inline] - fn len(&self) -> usize { - unreachable!() - } - - #[inline] - fn push(&mut self, _value: T) { - self.empty = false; - } -} diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index b5c53fda964..22f9af94530 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -2116,15 +2116,19 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2326,14 +2330,11 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", - "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2341,7 +2342,6 @@ dependencies = [ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock index 7b94768e030..c3a78c1ecca 100644 --- a/ports/geckolib/Cargo.lock +++ b/ports/geckolib/Cargo.lock @@ -450,16 +450,20 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "gecko_bindings 0.0.1", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -562,14 +566,11 @@ dependencies = [ "app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.4 (git+https://github.com/servo/ipc-channel)", - "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -577,7 +578,6 @@ dependencies = [ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/geckolib/data.rs b/ports/geckolib/data.rs index 9b2698409c9..1962243a310 100644 --- a/ports/geckolib/data.rs +++ b/ports/geckolib/data.rs @@ -14,9 +14,9 @@ use std::sync::{Arc, RwLock}; use style::dom::OpaqueNode; use style::media_queries::{Device, MediaType}; use style::parallel::WorkQueueData; +use style::workqueue::WorkQueue; use util::geometry::ViewportPx; use util::thread_state; -use util::workqueue::WorkQueue; pub struct PerDocumentStyleData { /// Rule processor. diff --git a/ports/geckolib/wrapper.rs b/ports/geckolib/wrapper.rs index 83dbac01064..2c32643c008 100644 --- a/ports/geckolib/wrapper.rs +++ b/ports/geckolib/wrapper.rs @@ -50,6 +50,7 @@ use style::properties::{PropertyDeclaration, PropertyDeclarationBlock}; use style::refcell::{Ref, RefCell, RefMut}; use style::restyle_hints::ElementSnapshot; use style::selector_impl::ElementExt; +use style::sink::Push; #[allow(unused_imports)] // Used in commented-out code. use url::Url; @@ -377,7 +378,7 @@ impl<'le> TElement for GeckoElement<'le> { impl<'le> PresentationalHintsSynthetizer for GeckoElement<'le> { fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, _hints: &mut V) - where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> + where V: Push<DeclarationBlock<Vec<PropertyDeclaration>>> { // FIXME(bholley) - Need to implement this. } |