mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Auto merge of #18018 - hiikezoe:list-style-type-animatable, r=emilio
Make list-style-type animatable <!-- Please describe your changes on the following line: --> https://bugzilla.mozilla.org/show_bug.cgi?id=1388652 --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors
This commit is contained in:
commit
f6aa17add9
4 changed files with 17 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
||||||
//! The context within which style is calculated.
|
//! The context within which style is calculated.
|
||||||
|
|
||||||
#[cfg(feature = "servo")] use animation::Animation;
|
#[cfg(feature = "servo")] use animation::Animation;
|
||||||
use animation::PropertyAnimation;
|
#[cfg(feature = "servo")] use animation::PropertyAnimation;
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
use bloom::StyleBloom;
|
use bloom::StyleBloom;
|
||||||
use cache::LRUCache;
|
use cache::LRUCache;
|
||||||
|
@ -293,6 +293,7 @@ pub struct CurrentElementInfo {
|
||||||
is_initial_style: bool,
|
is_initial_style: bool,
|
||||||
/// A Vec of possibly expired animations. Used only by Servo.
|
/// A Vec of possibly expired animations. Used only by Servo.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
pub possibly_expired_animations: Vec<PropertyAnimation>,
|
pub possibly_expired_animations: Vec<PropertyAnimation>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,6 +669,17 @@ impl<E: TElement> ThreadLocalStyleContext<E> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
/// Notes when the style system starts traversing an element.
|
||||||
|
pub fn begin_element(&mut self, element: E, data: &ElementData) {
|
||||||
|
debug_assert!(self.current_element_info.is_none());
|
||||||
|
self.current_element_info = Some(CurrentElementInfo {
|
||||||
|
element: element.as_node().opaque(),
|
||||||
|
is_initial_style: !data.has_styles(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
/// Notes when the style system starts traversing an element.
|
/// Notes when the style system starts traversing an element.
|
||||||
pub fn begin_element(&mut self, element: E, data: &ElementData) {
|
pub fn begin_element(&mut self, element: E, data: &ElementData) {
|
||||||
debug_assert!(self.current_element_info.is_none());
|
debug_assert!(self.current_element_info.is_none());
|
||||||
|
|
|
@ -92,7 +92,7 @@ extern crate unicode_segmentation;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
pub mod animation;
|
#[cfg(feature = "servo")] pub mod animation;
|
||||||
pub mod applicable_declarations;
|
pub mod applicable_declarations;
|
||||||
#[allow(missing_docs)] // TODO.
|
#[allow(missing_docs)] // TODO.
|
||||||
#[cfg(feature = "servo")] pub mod attr;
|
#[cfg(feature = "servo")] pub mod attr;
|
||||||
|
|
|
@ -387,6 +387,7 @@ pub fn nscsspropertyid_is_transitionable(property: nsCSSPropertyID) -> bool {
|
||||||
|
|
||||||
/// An animated property interpolation between two computed values for that
|
/// An animated property interpolation between two computed values for that
|
||||||
/// property.
|
/// property.
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum AnimatedProperty {
|
pub enum AnimatedProperty {
|
||||||
|
@ -404,6 +405,7 @@ pub enum AnimatedProperty {
|
||||||
% endfor
|
% endfor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
impl AnimatedProperty {
|
impl AnimatedProperty {
|
||||||
/// Get the name of this property.
|
/// Get the name of this property.
|
||||||
pub fn name(&self) -> &'static str {
|
pub fn name(&self) -> &'static str {
|
||||||
|
|
|
@ -30,7 +30,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
||||||
animation_value_type="discrete",
|
animation_value_type="discrete",
|
||||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")}
|
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")}
|
||||||
% else:
|
% else:
|
||||||
<%helpers:longhand name="list-style-type" animation_value_type="none" boxed="True"
|
<%helpers:longhand name="list-style-type" animation_value_type="discrete" boxed="True"
|
||||||
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type">
|
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type">
|
||||||
use values::CustomIdent;
|
use values::CustomIdent;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
use values::computed::ComputedValueAsSpecified;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue