mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
style: Make scroll-timeline-{name|axis} be a coordinating list property group
Named scroll progress timelines are declared in the coordinated value list constructed from the longhands of the scroll-timeline shorthand property, which form a coordinating list property group with scroll-timeline-name as the coordinating list base property. In the meantime, we also update its shorthand to match the current spec. Differential Revision: https://phabricator.services.mozilla.com/D166596
This commit is contained in:
parent
47a54ced2b
commit
b024f5b2e7
4 changed files with 52 additions and 50 deletions
|
@ -5,10 +5,12 @@
|
|||
//! Rust helpers for Gecko's `nsStyleAutoArray`.
|
||||
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleAnimationArrayLength;
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleScrollTimelineArrayLength;
|
||||
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, StyleViewTimeline};
|
||||
use crate::gecko_bindings::structs::{StyleAnimation, StyleTransition};
|
||||
use crate::gecko_bindings::structs::{StyleScrollTimeline, StyleViewTimeline};
|
||||
use std::iter::{once, Chain, IntoIterator, Once};
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice::{Iter, IterMut};
|
||||
|
@ -88,6 +90,18 @@ impl nsStyleAutoArray<StyleViewTimeline> {
|
|||
}
|
||||
}
|
||||
|
||||
impl nsStyleAutoArray<StyleScrollTimeline> {
|
||||
/// Ensures that the array has length at least the given length.
|
||||
pub fn ensure_len(&mut self, len: usize) {
|
||||
unsafe {
|
||||
Gecko_EnsureStyleScrollTimelineArrayLength(
|
||||
self as *mut nsStyleAutoArray<StyleScrollTimeline> 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