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

Unified Diff: Source/bindings/scripts/v8_attributes.py

Issue 447523003: Move most DOM attributes to prototype chains Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8SVGTestInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_attributes.py
diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py
index af41aa9117800d9faac8a6e7ce34663dbd00470c..d5c524000ada2dd96d8c438f123766a76c1239bf 100644
--- a/Source/bindings/scripts/v8_attributes.py
+++ b/Source/bindings/scripts/v8_attributes.py
@@ -100,7 +100,7 @@ def attribute_context(interface, attribute):
'is_call_with_script_state': v8_utilities.has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'),
'is_check_security_for_node': is_check_security_for_node,
'is_custom_element_callbacks': is_custom_element_callbacks,
- 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes,
+ 'is_expose_js_accessors': should_expose_js_accessors(attribute, interface),
'is_getter_raises_exception': # [RaisesException]
'RaisesException' in extended_attributes and
extended_attributes['RaisesException'] in (None, 'Getter'),
@@ -487,6 +487,36 @@ def has_custom_setter(attribute):
extended_attributes['Custom'] in [None, 'Setter'])
+# [ExposeJSAccessors]
+def should_expose_js_accessors(attribute, interface):
+ extended_attributes = attribute.extended_attributes
+
+ # FIXME: We should move all DOM attributes to prototype chains
+ # (except for a couple that really need to stay on instances).
+ # These conditions are a hack to move DOM attributes that we can
+ # move easily to prototype chains. Eventually all the conditions
+ # will be gone.
+ return (not has_custom_getter(attribute) and
+ not has_custom_setter(attribute) and
+ not attribute.is_static and
+ 'Replaceable' not in extended_attributes and
+ 'Unforgeable' not in extended_attributes and
+ 'PutForwards' not in extended_attributes and
+ not v8_utilities.per_context_enabled_function_name(attribute) and
+ not v8_utilities.runtime_enabled_function_name(attribute) and
+ not is_constructor_attribute(attribute) and
+ not interface.name == 'Window' and
+ not interface.name == 'WorkerGlobalScope' and
+ not attribute.idl_type.base_type == 'EventHandler' and
+ not v8_utilities.indexed_property_getter(interface) and
+ not v8_utilities.indexed_property_setter(interface) and
+ not v8_utilities.indexed_property_deleter(interface) and
+ not v8_utilities.named_property_getter(interface) and
+ not v8_utilities.named_property_setter(interface) and
+ not v8_utilities.named_property_deleter(interface) and
+ 'OverrideBuiltins' not in interface.extended_attributes)
+
+
################################################################################
# Constructors
################################################################################
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8SVGTestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698