1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::css_rules::{CssRuleList, Location};
use crate::{PrintErr, Printer};
/// A [@starting-style](https://drafts.csswg.org/css-transitions-2/#defining-before-change-style-the-starting-style-rule) rule.
pub struct StartingStyleRule<R> {
/// Nested rules within the `@starting-style` rule.
pub rules: CssRuleList<R>,
/// The location of the rule in the source file.
pub loc: Location,
}
impl<R> StartingStyleRule<R> {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
dest.write_str("@starting-style")?;
dest.block(|d| {
d.newline()?;
self.rules.to_css(d)
})
}
}
impl<R> StartingStyleRule<R> {
pub(crate) fn deep_clone<'bump>(&self, bump: &'bump bun_alloc::Arena) -> Self
where
R: crate::generics::DeepClone<'bump>,
{
// PORT NOTE: `css.implementDeepClone` field-walk.
Self {
rules: self.rules.deep_clone(bump),
loc: self.loc,
}
}
}
// ported from: src/css/rules/starting_style.zig