| Index: third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py
|
| diff --git a/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py b/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py
|
| index 91fcb91019ae6878d5b94862eee0fd13e20d3e6f..b22e62dd3880ce965112e792368227c51a8c323e 100755
|
| --- a/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py
|
| +++ b/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py
|
| @@ -35,38 +35,30 @@ except ImportError:
|
| import sys
|
| import re
|
|
|
| +from json5_generator import Json5File # pylint: disable=W0403
|
| +
|
| def properties_from_file(file_name):
|
| + doc = Json5File.load_from_files([file_name])
|
| +
|
| properties = []
|
| propertyNames = set()
|
| - with open(file_name, "r") as f:
|
| - for line in f:
|
| - line = line.strip()
|
| - if not line or line.startswith("//") or "alias_for" in line:
|
| - continue
|
| - partition = re.split("[, ]", line)
|
| - name = partition[0]
|
| - attributes = partition[1:]
|
| - entry = {"name": name}
|
| - if "inherited" in attributes:
|
| - entry["inherited"] = True
|
| - if "svg" in attributes:
|
| - entry["svg"] = True
|
| - propertyNames.add(name)
|
| - longhands = line.partition("longhands=")[2].partition(",")[0]
|
| - if longhands:
|
| - entry["longhands"] = longhands.split(";")
|
| - properties.append(entry)
|
| + for entry in doc.name_dictionaries:
|
| + if entry["alias_for"]:
|
| + continue
|
| + properties.append(entry)
|
| + propertyNames.add(entry["name"])
|
|
|
| # Filter out unsupported longhands.
|
| for property in properties:
|
| if "longhands" not in property:
|
| continue
|
| - longhands = property["longhands"]
|
| + longhands = property["longhands"].split(";")
|
| longhands = [longhand for longhand in longhands if longhand in propertyNames]
|
| if not longhands:
|
| del property["longhands"]
|
| else:
|
| property["longhands"] = longhands
|
| +
|
| return properties
|
|
|
| properties = properties_from_file(sys.argv[1])
|
|
|