stylo: Implement scroll-snap-coordinate

MozReview-Commit-ID: 6mr4ktfeEGT
This commit is contained in:
Manish Goregaokar 2017-02-06 17:45:09 -08:00 committed by Manish Goregaokar
parent a095565a8c
commit 20796ee94e
4 changed files with 62 additions and 4 deletions

View file

@ -93,4 +93,13 @@ impl<T> nsTArray<T> {
let mut header = self.header_mut();
header.mLength = len;
}
/// Resizes an array containing only POD elements
///
/// This will not leak since it only works on POD types (and thus doesn't assert)
pub unsafe fn set_len_pod(&mut self, len: u32) where T: Copy {
self.ensure_capacity(len as usize);
let mut header = unsafe { self.header_mut() };
header.mLength = len;
}
}