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:
Boris Chiou 2023-01-26 23:20:55 +00:00 committed by Martin Robinson
parent 47a54ced2b
commit b024f5b2e7
4 changed files with 52 additions and 50 deletions

View file

@ -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>>;