mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Replace gecko_autoarray_longhand with configurable vector_longhand
This commit is contained in:
parent
6bb5d0e846
commit
34c82d6e78
2 changed files with 11 additions and 6 deletions
|
@ -37,12 +37,17 @@
|
||||||
// and handle the empty case correctly
|
// and handle the empty case correctly
|
||||||
<%doc>
|
<%doc>
|
||||||
To be used in cases where we have a grammar like
|
To be used in cases where we have a grammar like
|
||||||
"<thing> [ , <thing> ]*", but only support a single value
|
"<thing> [ , <thing> ]*". `gecko_only` should be set
|
||||||
in servo
|
to True for cases where Servo takes a single value
|
||||||
|
and Stylo supports vector values.
|
||||||
|
|
||||||
|
If the computed value is the same as the specified value,
|
||||||
|
setting computed_is_specified to True will introduce additional
|
||||||
|
optimizations
|
||||||
</%doc>
|
</%doc>
|
||||||
<%def name="gecko_autoarray_longhand(name, **kwargs)">
|
<%def name="vector_longhand(name, gecko_only=False, **kwargs)">
|
||||||
<%call expr="longhand(name, **kwargs)">
|
<%call expr="longhand(name, **kwargs)">
|
||||||
% if product == "gecko":
|
% if product == "gecko" or not gecko_only:
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
|
||||||
"::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */",
|
"::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */",
|
||||||
animatable=True)}
|
animatable=True)}
|
||||||
|
|
||||||
<%helpers:gecko_autoarray_longhand name="background-image" animatable="False">
|
<%helpers:vector_longhand gecko_only="True" name="background-image" animatable="False">
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use values::specified::Image;
|
use values::specified::Image;
|
||||||
|
@ -70,7 +70,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</%helpers:gecko_autoarray_longhand>
|
</%helpers:vector_longhand>
|
||||||
|
|
||||||
<%helpers:longhand name="background-position" animatable="True">
|
<%helpers:longhand name="background-position" animatable="True">
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue