summaryrefslogtreecommitdiffstats
path: root/servo/components/style/properties
diff options
context:
space:
mode:
Diffstat (limited to 'servo/components/style/properties')
-rw-r--r--servo/components/style/properties/Mako-1.1.2-py2.py3-none-any.whlbin75521 -> 0 bytes
-rw-r--r--servo/components/style/properties/build.py1
-rw-r--r--servo/components/style/properties/cascade.rs2
-rw-r--r--servo/components/style/properties/gecko.mako.rs3
-rw-r--r--servo/components/style/properties/longhands/font.mako.rs6
-rw-r--r--servo/components/style/properties/longhands/ui.mako.rs14
-rw-r--r--servo/components/style/properties/shorthands/svg.mako.rs19
-rw-r--r--servo/components/style/properties/shorthands/ui.mako.rs41
8 files changed, 64 insertions, 22 deletions
diff --git a/servo/components/style/properties/Mako-1.1.2-py2.py3-none-any.whl b/servo/components/style/properties/Mako-1.1.2-py2.py3-none-any.whl
deleted file mode 100644
index 9593025a47..0000000000
--- a/servo/components/style/properties/Mako-1.1.2-py2.py3-none-any.whl
+++ /dev/null
Binary files differ
diff --git a/servo/components/style/properties/build.py b/servo/components/style/properties/build.py
index 6c3ee0cf66..42121a4eae 100644
--- a/servo/components/style/properties/build.py
+++ b/servo/components/style/properties/build.py
@@ -8,7 +8,6 @@ import re
import sys
BASE = os.path.dirname(__file__.replace("\\", "/"))
-sys.path.insert(0, os.path.join(BASE, "Mako-1.1.2-py2.py3-none-any.whl"))
sys.path.insert(0, BASE) # For importing `data.py`
from mako import exceptions
diff --git a/servo/components/style/properties/cascade.rs b/servo/components/style/properties/cascade.rs
index 59a8a65876..d4d48eaeb8 100644
--- a/servo/components/style/properties/cascade.rs
+++ b/servo/components/style/properties/cascade.rs
@@ -448,6 +448,8 @@ fn tweak_when_ignoring_colors(
// A few special-cases ahead.
match **declaration {
+ // Honor CSS-wide keywords like unset / revert / initial...
+ PropertyDeclaration::CSSWideKeyword(..) => return,
PropertyDeclaration::BackgroundColor(ref color) => {
// We honor system colors and transparent colors unconditionally.
//
diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs
index f5ae0cade3..8d3f90f8f5 100644
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1673,12 +1673,13 @@ mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x mask-
animation-direction animation-fill-mode
animation-play-state animation-iteration-count
animation-timing-function animation-composition animation-timeline
- transition-duration transition-delay
+ transition-behavior transition-duration transition-delay
transition-timing-function transition-property
scroll-timeline-name scroll-timeline-axis
view-timeline-name view-timeline-axis view-timeline-inset""" %>
<%self:impl_trait style_struct_name="UI" skip_longhands="${skip_ui_longhands}">
+ ${impl_coordinated_property('transition', 'behavior', 'Behavior')}
${impl_coordinated_property('transition', 'delay', 'Delay')}
${impl_coordinated_property('transition', 'duration', 'Duration')}
${impl_coordinated_property('transition', 'timing_function', 'TimingFunction')}
diff --git a/servo/components/style/properties/longhands/font.mako.rs b/servo/components/style/properties/longhands/font.mako.rs
index f188af5b1f..4583de0bd7 100644
--- a/servo/components/style/properties/longhands/font.mako.rs
+++ b/servo/components/style/properties/longhands/font.mako.rs
@@ -305,10 +305,7 @@ ${helpers.predefined_type(
"MathDepth",
"0",
engines="gecko",
- gecko_pref="layout.css.math-depth.enabled",
- has_effect_on_gecko_scrollbars=False,
animation_value_type="none",
- enabled_in="ua",
spec="https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property",
affects="",
)}
@@ -318,11 +315,8 @@ ${helpers.single_keyword(
"normal compact",
engines="gecko",
gecko_enum_prefix="StyleMathStyle",
- gecko_pref="layout.css.math-style.enabled",
spec="https://mathml-refresh.github.io/mathml-core/#the-math-style-property",
- has_effect_on_gecko_scrollbars=False,
animation_value_type="none",
- enabled_in="ua",
needs_conversion=True,
affects="layout",
)}
diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs
index 1150816ac0..58006e0d65 100644
--- a/servo/components/style/properties/longhands/ui.mako.rs
+++ b/servo/components/style/properties/longhands/ui.mako.rs
@@ -199,6 +199,20 @@ ${helpers.predefined_type(
affects="",
)}
+${helpers.predefined_type(
+ "transition-behavior",
+ "TransitionBehavior",
+ "computed::TransitionBehavior::normal()",
+ engines="gecko",
+ initial_specified_value="specified::TransitionBehavior::normal()",
+ vector=True,
+ need_index=True,
+ animation_value_type="none",
+ gecko_pref="layout.css.transition-behavior.enabled",
+ spec="https://drafts.csswg.org/css-transitions-2/#transition-behavior-property",
+ affects="",
+)}
+
<% animation_extra_prefixes = "moz:layout.css.prefixes.animations webkit" %>
${helpers.predefined_type(
diff --git a/servo/components/style/properties/shorthands/svg.mako.rs b/servo/components/style/properties/shorthands/svg.mako.rs
index cf34b116ee..195427dad5 100644
--- a/servo/components/style/properties/shorthands/svg.mako.rs
+++ b/servo/components/style/properties/shorthands/svg.mako.rs
@@ -144,8 +144,8 @@
// <mask-reference> ||
// <position> [ / <bg-size> ]? ||
// <repeat-style> ||
- // <geometry-box> ||
- // [ <geometry-box> | no-clip ] ||
+ // <coord-box> ||
+ // [ <coord-box> | no-clip ] ||
// <compositing-operator> ||
// <masking-mode>
// https://drafts.fxtf.org/css-masking-1/#the-mask
@@ -198,12 +198,21 @@
writer.item(repeat)?;
}
- // <geometry-box>
- if has_origin {
+ // <coord-box>
+ // Note:
+ // Even if 'mask-origin' is at its initial value 'border-box',
+ // we still have to serialize it to avoid ambiguity iF the
+ // 'mask-clip' longhand has some other <coord-box> value
+ // (i.e. neither 'border-box' nor 'no-clip'). (If we naively
+ // declined to serialize the 'mask-origin' value in this
+ // situation, then whatever value we serialize for 'mask-clip'
+ // would implicitly also represent 'mask-origin' and would be
+ // providing the wrong value for that longhand.)
+ if has_origin || (has_clip && *clip != Clip::NoClip) {
writer.item(origin)?;
}
- // [ <geometry-box> | no-clip ]
+ // [ <coord-box> | no-clip ]
if has_clip && *clip != From::from(*origin) {
writer.item(clip)?;
}
diff --git a/servo/components/style/properties/shorthands/ui.mako.rs b/servo/components/style/properties/shorthands/ui.mako.rs
index 1fdb5965fc..4a27d5e003 100644
--- a/servo/components/style/properties/shorthands/ui.mako.rs
+++ b/servo/components/style/properties/shorthands/ui.mako.rs
@@ -22,10 +22,10 @@ macro_rules! try_parse_one {
extra_prefixes="moz:layout.css.prefixes.transitions webkit"
sub_properties="transition-property transition-duration
transition-timing-function
- transition-delay"
+ transition-delay transition-behavior"
spec="https://drafts.csswg.org/css-transitions/#propdef-transition">
use crate::parser::Parse;
- % for prop in "delay duration property timing_function".split():
+ % for prop in "delay duration property timing_function behavior".split():
use crate::properties::longhands::transition_${prop};
% endfor
use crate::values::specified::TransitionProperty;
@@ -35,7 +35,7 @@ macro_rules! try_parse_one {
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
struct SingleTransition {
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
transition_${prop}: transition_${prop}::SingleSpecifiedValue,
% endfor
}
@@ -45,7 +45,7 @@ macro_rules! try_parse_one {
input: &mut Parser<'i, 't>,
first: bool,
) -> Result<SingleTransition,ParseError<'i>> {
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
let mut ${prop} = None;
% endfor
@@ -56,6 +56,9 @@ macro_rules! try_parse_one {
try_parse_one!(context, input, duration, transition_duration);
try_parse_one!(context, input, timing_function, transition_timing_function);
try_parse_one!(context, input, delay, transition_delay);
+ if static_prefs::pref!("layout.css.transition-behavior.enabled") {
+ try_parse_one!(context, input, behavior, transition_behavior);
+ }
// Must check 'transition-property' after 'transition-timing-function' since
// 'transition-property' accepts any keyword.
if property.is_none() {
@@ -78,7 +81,7 @@ macro_rules! try_parse_one {
if parsed != 0 {
Ok(SingleTransition {
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
transition_${prop}: ${prop}.unwrap_or_else(transition_${prop}::single_value
::get_initial_specified_value),
% endfor
@@ -88,7 +91,7 @@ macro_rules! try_parse_one {
}
}
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
let mut ${prop}s = Vec::new();
% endfor
@@ -105,13 +108,13 @@ macro_rules! try_parse_one {
Ok(transition)
})?;
for result in results {
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
${prop}s.push(result.transition_${prop});
% endfor
}
Ok(expanded! {
- % for prop in "property duration timing_function delay".split():
+ % for prop in "property duration timing_function delay behavior".split():
transition_${prop}: transition_${prop}::SpecifiedValue(${prop}s.into()),
% endfor
})
@@ -133,12 +136,24 @@ macro_rules! try_parse_one {
return Ok(());
}
% endfor
+
+ if let Some(behavior) = self.transition_behavior {
+ if behavior.0.len() != 1 {
+ return Ok(());
+ }
+ }
} else {
% for name in "duration delay timing_function".split():
if self.transition_${name}.0.len() != property_len {
return Ok(());
}
% endfor
+
+ if let Some(behavior) = self.transition_behavior {
+ if behavior.0.len() != property_len {
+ return Ok(());
+ }
+ }
}
// Representative length.
@@ -152,7 +167,11 @@ macro_rules! try_parse_one {
let has_duration = !self.transition_duration.0[i].is_zero();
let has_timing = !self.transition_timing_function.0[i].is_ease();
let has_delay = !self.transition_delay.0[i].is_zero();
- let has_any = has_duration || has_timing || has_delay;
+ let has_behavior = match self.transition_behavior {
+ Some(behavior) => !behavior.0[i].is_normal(),
+ _ => false,
+ };
+ let has_any = has_duration || has_timing || has_delay || has_behavior;
let mut writer = SequenceWriter::new(dest, " ");
@@ -174,6 +193,10 @@ macro_rules! try_parse_one {
if has_delay {
writer.item(&self.transition_delay.0[i])?;
}
+
+ if has_behavior {
+ writer.item(&self.transition_behavior.unwrap().0[i])?;
+ }
}
Ok(())
}