mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Support view-timeline-name and view-timeline-axis in style system
view-timeline-name: `none | <custom-ident>#` view-timeline-axis: `[ block | inline | vertical | horizontal ]#` Note: Both view-timeline-name and scroll-timeline-name should accept `auto`. We will fix it in this patch series. Differential Revision: https://phabricator.services.mozilla.com/D166242
This commit is contained in:
parent
863716a0a1
commit
b5b64af3f1
3 changed files with 55 additions and 12 deletions
|
@ -6,8 +6,9 @@
|
|||
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleAnimationArrayLength;
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleTransitionArrayLength;
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleViewTimelineArrayLength;
|
||||
use crate::gecko_bindings::structs::nsStyleAutoArray;
|
||||
use crate::gecko_bindings::structs::{StyleAnimation, StyleTransition};
|
||||
use crate::gecko_bindings::structs::{StyleAnimation, StyleTransition, StyleViewTimeline};
|
||||
use std::iter::{once, Chain, IntoIterator, Once};
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice::{Iter, IterMut};
|
||||
|
@ -75,6 +76,18 @@ impl nsStyleAutoArray<StyleTransition> {
|
|||
}
|
||||
}
|
||||
|
||||
impl nsStyleAutoArray<StyleViewTimeline> {
|
||||
/// Ensures that the array has length at least the given length.
|
||||
pub fn ensure_len(&mut self, len: usize) {
|
||||
unsafe {
|
||||
Gecko_EnsureStyleViewTimelineArrayLength(
|
||||
self as *mut nsStyleAutoArray<StyleViewTimeline> as *mut _,
|
||||
len,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> IntoIterator for &'a mut nsStyleAutoArray<T> {
|
||||
type Item = &'a mut T;
|
||||
type IntoIter = Chain<Once<&'a mut T>, IterMut<'a, T>>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue