Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: Source/bindings/scripts/unstable/v8_utilities.py

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and review changes Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/unstable/v8_utilities.py
diff --git a/Source/bindings/scripts/unstable/v8_utilities.py b/Source/bindings/scripts/unstable/v8_utilities.py
index 6a842a2ec5f1c8820a4a9eeda5d1c1ec266761ae..d3cf75950f9c7d2f69915e28f575bcafa9ca4aaf 100644
--- a/Source/bindings/scripts/unstable/v8_utilities.py
+++ b/Source/bindings/scripts/unstable/v8_utilities.py
@@ -37,9 +37,11 @@ For details, see bug http://crbug.com/239771
# FIXME: eliminate this file if possible
+import re
import v8_types
ACRONYMS = ['CSS', 'HTML', 'IME', 'JS', 'SVG', 'URL', 'WOFF', 'XML', 'XSLT']
+extended_attribute_value_separator_re = re.compile('[|&]')
def cpp_implemented_as_name(definition_or_member):
@@ -85,3 +87,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 extended_attribute_value_separator_re.split(values_string)
« no previous file with comments | « Source/bindings/scripts/unstable/v8_callback_interface.py ('k') | Source/bindings/templates/callback_interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698