Skip to content

Commit

Permalink
Fix #6680
Browse files Browse the repository at this point in the history
  • Loading branch information
bgdncz committed Jul 22, 2015
1 parent e10a524 commit 681b11c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions components/gfx/display_list/mod.rs
Expand Up @@ -32,7 +32,7 @@ use libc::uintptr_t;
use msg::compositor_msg::{LayerId, LayerKind};
use net_traits::image::base::Image;
use paint_task::PaintLayer;
use smallvec::SmallVec8;
use smallvec::SmallVec;
use std::collections::linked_list::{self, LinkedList};
use std::fmt;
use std::slice::Iter;
Expand Down Expand Up @@ -313,7 +313,7 @@ impl StackingContext {
}

// 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() {
positioned_children.push((*kid).clone());
}
Expand Down
6 changes: 3 additions & 3 deletions components/gfx/font.rs
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use euclid::{Point2D, Rect, Size2D};
use smallvec::SmallVec8;
use smallvec::SmallVec;
use std::borrow::ToOwned;
use std::mem;
use std::slice;
Expand Down Expand Up @@ -204,11 +204,11 @@ impl Font {
}

pub struct FontGroup {
pub fonts: SmallVec8<Rc<RefCell<Font>>>,
pub fonts: SmallVec<[Rc<RefCell<Font>>; 8]>,
}

impl FontGroup {
pub fn new(fonts: SmallVec8<Rc<RefCell<Font>>>) -> FontGroup {
pub fn new(fonts: SmallVec<[Rc<RefCell<Font>>; 8]>) -> FontGroup {
FontGroup {
fonts: fonts,
}
Expand Down
4 changes: 2 additions & 2 deletions components/gfx/font_context.rs
Expand Up @@ -13,7 +13,7 @@ use font_template::FontTemplateDescriptor;
use fnv::FnvHasher;
use platform::font::FontHandle;
use platform::font_template::FontTemplateData;
use smallvec::SmallVec8;
use smallvec::SmallVec;
use string_cache::Atom;
use util::cache::HashCache;
use util::geometry::Au;
Expand Down Expand Up @@ -159,7 +159,7 @@ impl FontContext {
style.font_style == font_style::T::italic ||
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() {
// GWTODO: Check on real pages if this is faster as Vec() or HashMap().
Expand Down
8 changes: 4 additions & 4 deletions components/layout/css/matching.rs
Expand Up @@ -11,7 +11,7 @@ use context::SharedLayoutContext;
use css::node_style::StyledNode;
use data::LayoutDataWrapper;
use incremental::{self, RestyleDamage};
use smallvec::SmallVec16;
use smallvec::SmallVec;
use wrapper::{LayoutElement, LayoutNode};

use script::dom::characterdata::CharacterDataTypeId;
Expand All @@ -38,7 +38,7 @@ use util::opts;
use util::vec::ForgetfulSink;

pub struct ApplicableDeclarations {
pub normal: SmallVec16<DeclarationBlock>,
pub normal: SmallVec<[DeclarationBlock; 16]>,
pub before: Vec<DeclarationBlock>,
pub after: Vec<DeclarationBlock>,

Expand All @@ -49,15 +49,15 @@ pub struct ApplicableDeclarations {
impl ApplicableDeclarations {
pub fn new() -> ApplicableDeclarations {
ApplicableDeclarations {
normal: SmallVec16::new(),
normal: SmallVec::new(),
before: Vec::new(),
after: Vec::new(),
normal_shareable: false,
}
}

pub fn clear(&mut self) {
self.normal = SmallVec16::new();
self.normal = SmallVec::new();
self.before = Vec::new();
self.after = Vec::new();
self.normal_shareable = false;
Expand Down
6 changes: 3 additions & 3 deletions components/layout/generated_content.rs
Expand Up @@ -13,7 +13,7 @@ use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, Immutab
use flow::{InorderFlowTraversal};
use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
use incremental::{self, RESOLVE_GENERATED_CONTENT};
use smallvec::SmallVec8;
use smallvec::SmallVec;
use text::TextRunScanner;

use gfx::display_list::OpaqueNode;
Expand Down Expand Up @@ -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
/// the accumulator per CSS-COUNTER-STYLES § 3.1.4.
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 {
// Step 1.
value = value - 1;
Expand All @@ -545,7 +545,7 @@ fn push_numeric_representation(mut value: i32, system: &[char], accumulator: &mu
}

// Step 2.
let mut string = SmallVec8::new();
let mut string: SmallVec<[char; 8]> = SmallVec::new();
while value != 0 {
// Step 2.1.
string.push(system[(value as usize) % system.len()]);
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/bindings/trace.rs
Expand Up @@ -57,7 +57,7 @@ use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
use net_traits::storage_task::StorageType;
use script_traits::ScriptControlChan;
use script_traits::UntrustedNodeAddress;
use smallvec::SmallVec1;
use smallvec::SmallVec;
use msg::compositor_msg::ScriptListener;
use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image;
Expand Down Expand Up @@ -219,7 +219,7 @@ impl<T: JSTraceable> JSTraceable for Vec<T> {

// 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)
impl<T: JSTraceable + 'static> JSTraceable for SmallVec1<T> {
impl<T: JSTraceable + 'static> JSTraceable for SmallVec<[T; 1]> {
#[inline]
fn trace(&self, trc: *mut JSTracer) {
for e in self.iter() {
Expand Down
6 changes: 3 additions & 3 deletions components/style/stylesheets.rs
Expand Up @@ -18,7 +18,7 @@ use parser::{ParserContext, log_css_error};
use properties::{PropertyDeclarationBlock, parse_property_declaration_list};
use media_queries::{Device, MediaQueryList, parse_media_query_list};
use font_face::{FontFaceRule, parse_font_face_block};
use smallvec::SmallVec2;
use smallvec::SmallVec;
use viewport::ViewportRule;


Expand Down Expand Up @@ -161,13 +161,13 @@ impl Stylesheet {
/// conditional group rule will come before its nested rules.
pub struct Rules<'a> {
// 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>
}

impl<'a> 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);

Rules { stack: stack, device: device }
Expand Down

0 comments on commit 681b11c

Please sign in to comment.