mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Add a script to list all CSS properties parsed by Servo.
This commit is contained in:
parent
679d1280dd
commit
9d29c3d2f5
2 changed files with 22 additions and 0 deletions
14
components/style/list_properties.py
Executable file
14
components/style/list_properties.py
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/env python2.7
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
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 = template.module.LONGHANDS + template.module.SHORTHANDS
|
||||||
|
for name in sorted(p.name for p in properties):
|
||||||
|
print(name)
|
|
@ -158,6 +158,14 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
||||||
help="Only run tests that match this pattern or file path")
|
help="Only run tests that match this pattern or file path")
|
||||||
def test_unit(self, test_name=None, package=None):
|
def test_unit(self, test_name=None, package=None):
|
||||||
|
properties = subprocess.check_output([
|
||||||
|
sys.executable,
|
||||||
|
path.join(self.context.topdir, "components", "style", "list_properties.py")
|
||||||
|
]).splitlines()
|
||||||
|
assert len(properties) >= 100
|
||||||
|
assert "margin-top" in properties
|
||||||
|
assert "margin" in properties
|
||||||
|
|
||||||
if test_name is None:
|
if test_name is None:
|
||||||
test_name = []
|
test_name = []
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue