Chromium Code Reviews| Index: Source/bindings/scripts/v8_utilities.py |
| diff --git a/Source/bindings/scripts/v8_utilities.py b/Source/bindings/scripts/v8_utilities.py |
| index 93b85ab2d05d7fd043ebc4e01e86cab1b3244395..1bd258e42c05546bc8b5beb85cc72fa8001cc89d 100644 |
| --- a/Source/bindings/scripts/v8_utilities.py |
| +++ b/Source/bindings/scripts/v8_utilities.py |
| @@ -28,6 +28,7 @@ |
| # FIXME: eliminate this file if possible |
| +import re |
| import v8_types |
| ACRONYMS = ['CSS', 'HTML', 'IME', 'JS', 'SVG', 'URL', 'WOFF', 'XML', 'XSLT'] |
| @@ -81,3 +82,16 @@ def uncapitalize(name): |
| def v8_class_name(interface): |
| return v8_types.v8_type(interface.name) |
| + |
| + |
| +def has_extended_attribute_value(extended_attributes, key, value): |
| + return key in extended_attributes and value in extended_attribute_values(extended_attributes, key) |
| + |
| + |
| +def extended_attribute_values(extended_attributes, key): |
| + if key not in extended_attributes: |
| + return None |
| + values_string = extended_attributes[key] |
| + if not values_string: |
| + return [] |
| + return re.split('[|&]', values_string) |
|
esprehn
2013/09/28 00:44:36
This will compile the regex repeatedly...
alancutter (OOO until 2018)
2013/09/30 02:54:52
Moved to precompiled module variable.
|