This commit is contained in:
Bogdan Cuza 2015-07-21 16:35:50 +03:00
parent e10a524c81
commit 681b11c08b
7 changed files with 19 additions and 19 deletions

View file

@ -32,7 +32,7 @@ use libc::uintptr_t;
use msg::compositor_msg::{LayerId, LayerKind}; use msg::compositor_msg::{LayerId, LayerKind};
use net_traits::image::base::Image; use net_traits::image::base::Image;
use paint_task::PaintLayer; use paint_task::PaintLayer;
use smallvec::SmallVec8; use smallvec::SmallVec;
use std::collections::linked_list::{self, LinkedList}; use std::collections::linked_list::{self, LinkedList};
use std::fmt; use std::fmt;
use std::slice::Iter; use std::slice::Iter;
@ -313,7 +313,7 @@ impl StackingContext {
} }
// Sort positioned children according to z-index. // Sort positioned children according to z-index.
let mut positioned_children = SmallVec8::new(); let mut positioned_children: SmallVec<[Arc<StackingContext>; 8]> = SmallVec::new();
for kid in display_list.children.iter() { for kid in display_list.children.iter() {
positioned_children.push((*kid).clone()); positioned_children.push((*kid).clone());
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use euclid::{Point2D, Rect, Size2D}; use euclid::{Point2D, Rect, Size2D};
use smallvec::SmallVec8; use smallvec::SmallVec;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem; use std::mem;
use std::slice; use std::slice;
@ -204,11 +204,11 @@ impl Font {
} }
pub struct FontGroup { pub struct FontGroup {
pub fonts: SmallVec8<Rc<RefCell<Font>>>, pub fonts: SmallVec<[Rc<RefCell<Font>>; 8]>,
} }
impl FontGroup { impl FontGroup {
pub fn new(fonts: SmallVec8<Rc<RefCell<Font>>>) -> FontGroup { pub fn new(fonts: SmallVec<[Rc<RefCell<Font>>; 8]>) -> FontGroup {
FontGroup { FontGroup {
fonts: fonts, fonts: fonts,
} }

View file

@ -13,7 +13,7 @@ use font_template::FontTemplateDescriptor;
use fnv::FnvHasher; use fnv::FnvHasher;
use platform::font::FontHandle; use platform::font::FontHandle;
use platform::font_template::FontTemplateData; use platform::font_template::FontTemplateData;
use smallvec::SmallVec8; use smallvec::SmallVec;
use string_cache::Atom; use string_cache::Atom;
use util::cache::HashCache; use util::cache::HashCache;
use util::geometry::Au; use util::geometry::Au;
@ -159,7 +159,7 @@ impl FontContext {
style.font_style == font_style::T::italic || style.font_style == font_style::T::italic ||
style.font_style == font_style::T::oblique); style.font_style == font_style::T::oblique);
let mut fonts = SmallVec8::new(); let mut fonts: SmallVec<[Rc<RefCell<Font>>; 8]> = SmallVec::new();
for family in style.font_family.0.iter() { for family in style.font_family.0.iter() {
// GWTODO: Check on real pages if this is faster as Vec() or HashMap(). // GWTODO: Check on real pages if this is faster as Vec() or HashMap().

View file

@ -11,7 +11,7 @@ use context::SharedLayoutContext;
use css::node_style::StyledNode; use css::node_style::StyledNode;
use data::LayoutDataWrapper; use data::LayoutDataWrapper;
use incremental::{self, RestyleDamage}; use incremental::{self, RestyleDamage};
use smallvec::SmallVec16; use smallvec::SmallVec;
use wrapper::{LayoutElement, LayoutNode}; use wrapper::{LayoutElement, LayoutNode};
use script::dom::characterdata::CharacterDataTypeId; use script::dom::characterdata::CharacterDataTypeId;
@ -38,7 +38,7 @@ use util::opts;
use util::vec::ForgetfulSink; use util::vec::ForgetfulSink;
pub struct ApplicableDeclarations { pub struct ApplicableDeclarations {
pub normal: SmallVec16<DeclarationBlock>, pub normal: SmallVec<[DeclarationBlock; 16]>,
pub before: Vec<DeclarationBlock>, pub before: Vec<DeclarationBlock>,
pub after: Vec<DeclarationBlock>, pub after: Vec<DeclarationBlock>,
@ -49,7 +49,7 @@ pub struct ApplicableDeclarations {
impl ApplicableDeclarations { impl ApplicableDeclarations {
pub fn new() -> ApplicableDeclarations { pub fn new() -> ApplicableDeclarations {
ApplicableDeclarations { ApplicableDeclarations {
normal: SmallVec16::new(), normal: SmallVec::new(),
before: Vec::new(), before: Vec::new(),
after: Vec::new(), after: Vec::new(),
normal_shareable: false, normal_shareable: false,
@ -57,7 +57,7 @@ impl ApplicableDeclarations {
} }
pub fn clear(&mut self) { pub fn clear(&mut self) {
self.normal = SmallVec16::new(); self.normal = SmallVec::new();
self.before = Vec::new(); self.before = Vec::new();
self.after = Vec::new(); self.after = Vec::new();
self.normal_shareable = false; self.normal_shareable = false;

View file

@ -13,7 +13,7 @@ use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, Immutab
use flow::{InorderFlowTraversal}; use flow::{InorderFlowTraversal};
use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
use incremental::{self, RESOLVE_GENERATED_CONTENT}; use incremental::{self, RESOLVE_GENERATED_CONTENT};
use smallvec::SmallVec8; use smallvec::SmallVec;
use text::TextRunScanner; use text::TextRunScanner;
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
@ -522,7 +522,7 @@ pub fn static_representation(list_style_type: list_style_type::T) -> char {
/// Pushes the string that represents the value rendered using the given *alphabetic system* onto /// Pushes the string that represents the value rendered using the given *alphabetic system* onto
/// the accumulator per CSS-COUNTER-STYLES § 3.1.4. /// the accumulator per CSS-COUNTER-STYLES § 3.1.4.
fn push_alphabetic_representation(mut value: i32, system: &[char], accumulator: &mut String) { fn push_alphabetic_representation(mut value: i32, system: &[char], accumulator: &mut String) {
let mut string = SmallVec8::new(); let mut string: SmallVec<[char; 8]> = SmallVec::new();
while value != 0 { while value != 0 {
// Step 1. // Step 1.
value = value - 1; value = value - 1;
@ -545,7 +545,7 @@ fn push_numeric_representation(mut value: i32, system: &[char], accumulator: &mu
} }
// Step 2. // Step 2.
let mut string = SmallVec8::new(); let mut string: SmallVec<[char; 8]> = SmallVec::new();
while value != 0 { while value != 0 {
// Step 2.1. // Step 2.1.
string.push(system[(value as usize) % system.len()]); string.push(system[(value as usize) % system.len()]);

View file

@ -57,7 +57,7 @@ use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
use net_traits::storage_task::StorageType; use net_traits::storage_task::StorageType;
use script_traits::ScriptControlChan; use script_traits::ScriptControlChan;
use script_traits::UntrustedNodeAddress; use script_traits::UntrustedNodeAddress;
use smallvec::SmallVec1; use smallvec::SmallVec;
use msg::compositor_msg::ScriptListener; use msg::compositor_msg::ScriptListener;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image; use net_traits::image::base::Image;
@ -219,7 +219,7 @@ impl<T: JSTraceable> JSTraceable for Vec<T> {
// XXXManishearth Check if the following three are optimized to no-ops // XXXManishearth Check if the following three are optimized to no-ops
// if e.trace() is a no-op (e.g it is an no_jsmanaged_fields type) // if e.trace() is a no-op (e.g it is an no_jsmanaged_fields type)
impl<T: JSTraceable + 'static> JSTraceable for SmallVec1<T> { impl<T: JSTraceable + 'static> JSTraceable for SmallVec<[T; 1]> {
#[inline] #[inline]
fn trace(&self, trc: *mut JSTracer) { fn trace(&self, trc: *mut JSTracer) {
for e in self.iter() { for e in self.iter() {

View file

@ -18,7 +18,7 @@ use parser::{ParserContext, log_css_error};
use properties::{PropertyDeclarationBlock, parse_property_declaration_list}; use properties::{PropertyDeclarationBlock, parse_property_declaration_list};
use media_queries::{Device, MediaQueryList, parse_media_query_list}; use media_queries::{Device, MediaQueryList, parse_media_query_list};
use font_face::{FontFaceRule, parse_font_face_block}; use font_face::{FontFaceRule, parse_font_face_block};
use smallvec::SmallVec2; use smallvec::SmallVec;
use viewport::ViewportRule; use viewport::ViewportRule;
@ -161,13 +161,13 @@ impl Stylesheet {
/// conditional group rule will come before its nested rules. /// conditional group rule will come before its nested rules.
pub struct Rules<'a> { pub struct Rules<'a> {
// 2 because normal case is likely to be just one level of nesting (@media) // 2 because normal case is likely to be just one level of nesting (@media)
stack: SmallVec2<slice::Iter<'a, CSSRule>>, stack: SmallVec<[slice::Iter<'a, CSSRule>; 2]>,
device: Option<&'a Device> device: Option<&'a Device>
} }
impl<'a> Rules<'a> { impl<'a> Rules<'a> {
fn new(iter: slice::Iter<'a, CSSRule>, device: Option<&'a Device>) -> Rules<'a> { fn new(iter: slice::Iter<'a, CSSRule>, device: Option<&'a Device>) -> Rules<'a> {
let mut stack = SmallVec2::new(); let mut stack: SmallVec<[slice::Iter<'a, CSSRule>; 2]> = SmallVec::new();
stack.push(iter); stack.push(iter);
Rules { stack: stack, device: device } Rules { stack: stack, device: device }