aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-01-16 01:06:03 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-01-16 01:06:03 +0530
commitdba1f27305c5e81eda6acd4c438a2adfb6ed053d (patch)
tree2b06049daf2a073e778a893861b9a5455ad5cb65 /components
parent4cb2c87982355bdf2a2dd409db71d0d4ed6f9a85 (diff)
parent2222f345c8a024d319f6f6f89d2517c3633c8c6d (diff)
downloadservo-dba1f27305c5e81eda6acd4c438a2adfb6ed053d.tar.gz
servo-dba1f27305c5e81eda6acd4c438a2adfb6ed053d.zip
Auto merge of #9333 - servo:list-properties, r=larsbergstrom
Add a script to list all CSS properties parsed by Servo. I’ve been asked for that list by two different people this week :) r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9333) <!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r--components/style/list_properties.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/components/style/list_properties.py b/components/style/list_properties.py
new file mode 100644
index 00000000000..63bbe247511
--- /dev/null
+++ b/components/style/list_properties.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os.path
+import sys
+import json
+
+style = os.path.dirname(__file__)
+sys.path.insert(0, os.path.join(style, "Mako-0.9.1.zip"))
+from mako.template import Template
+
+template = Template(filename=os.path.join(style, "properties.mako.rs"), input_encoding='utf8')
+template.render()
+properties = dict(
+ (p.name, {
+ "flag": p.experimental,
+ "shorthand": hasattr(p, "sub_properties")
+ })
+ for p in template.module.LONGHANDS + template.module.SHORTHANDS
+)
+print(json.dumps(properties, indent=4))