mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto-generate CSSStyleDeclaration.webidl for CSS properties based on the style crate
This commit is contained in:
parent
447ae1eae6
commit
f1300bb98b
7 changed files with 83 additions and 485 deletions
|
@ -8,7 +8,7 @@ publish = false
|
|||
build = "build.rs"
|
||||
|
||||
# https://github.com/rust-lang/cargo/issues/3544
|
||||
links = "for some reason the links key is required to pass data around between build scripts"
|
||||
links = "servo_style_crate"
|
||||
|
||||
[lib]
|
||||
name = "style"
|
||||
|
|
|
@ -94,6 +94,15 @@ def main():
|
|||
template = os.path.join(BASE, "gecko.mako.rs")
|
||||
rust = render(template, data=properties)
|
||||
write(OUT_DIR, "gecko_properties.rs", rust)
|
||||
|
||||
if product == "servo":
|
||||
names_and_prefs = [
|
||||
(prop.name, prop.servo_pref)
|
||||
for p in properties.longhands + properties.shorthands
|
||||
if p.enabled_in_content()
|
||||
for prop in [p] + p.alias
|
||||
]
|
||||
write(OUT_DIR, "css_properties.json", json.dumps(names_and_prefs, indent=4))
|
||||
elif output == "geckolib":
|
||||
if len(sys.argv) < 4:
|
||||
abort(usage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue