mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Auto merge of #19316 - servo:stylo-size-of, r=emilio
Fix Stylo tests to pass on both Stable and Nightly Rust This is on top of https://github.com/servo/servo/pull/19285. Rust Nightly has new enum memory layout optimizations: https://github.com/rust-lang/rust/pull/45225 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19316) <!-- Reviewable:end -->
This commit is contained in:
commit
17e97b9320
7 changed files with 25 additions and 7 deletions
|
@ -76,6 +76,16 @@ fn generate_properties() {
|
|||
.arg(&script)
|
||||
.arg(product)
|
||||
.arg("style-crate")
|
||||
.envs(if std::mem::size_of::<Option<bool>>() == 1 {
|
||||
// FIXME: remove this envs() call
|
||||
// and make unconditional code that depends on RUSTC_HAS_PR45225
|
||||
// once Firefox requires Rust 1.23+
|
||||
|
||||
// https://github.com/rust-lang/rust/pull/45225
|
||||
vec![("RUSTC_HAS_PR45225", "1")]
|
||||
} else {
|
||||
vec![]
|
||||
})
|
||||
.status()
|
||||
.unwrap();
|
||||
if !status.success() {
|
||||
|
|
|
@ -32,7 +32,8 @@ def main():
|
|||
|
||||
properties = data.PropertiesData(product=product)
|
||||
template = os.path.join(BASE, "properties.mako.rs")
|
||||
rust = render(template, product=product, data=properties, __file__=template)
|
||||
rust = render(template, product=product, data=properties, __file__=template,
|
||||
RUSTC_HAS_PR45225=os.environ.get("RUSTC_HAS_PR45225"))
|
||||
if output == "style-crate":
|
||||
write(os.environ["OUT_DIR"], "properties.rs", rust)
|
||||
if product == "gecko":
|
||||
|
|
|
@ -140,7 +140,7 @@ class Keyword(object):
|
|||
def arg_to_bool(arg):
|
||||
if isinstance(arg, bool):
|
||||
return arg
|
||||
assert arg in ["True", "False"]
|
||||
assert arg in ["True", "False"], "Unexpected value for boolean arguement: " + repr(arg)
|
||||
return arg == "True"
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ ${helpers.predefined_type(
|
|||
"stroke-width", "SVGWidth",
|
||||
"::values::computed::NonNegativeLength::new(1.).into()",
|
||||
products="gecko",
|
||||
boxed="True",
|
||||
boxed=not RUSTC_HAS_PR45225,
|
||||
animation_value_type="::values::computed::SVGWidth",
|
||||
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth")}
|
||||
|
||||
|
@ -101,7 +101,7 @@ ${helpers.predefined_type(
|
|||
"stroke-dashoffset", "SVGLength",
|
||||
"Au(0).into()",
|
||||
products="gecko",
|
||||
boxed="True",
|
||||
boxed=not RUSTC_HAS_PR45225,
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing")}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ ${helpers.predefined_type(
|
|||
"Either::Second(Auto)",
|
||||
spec="https://drafts.csswg.org/css-ui/#caret-color",
|
||||
animation_value_type="Either<AnimatedColor, Auto>",
|
||||
boxed=True,
|
||||
boxed=not RUSTC_HAS_PR45225,
|
||||
ignored_when_colors_disabled=True,
|
||||
products="gecko",
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue