Index: third_party/WebKit/Source/bindings/scripts/v8_interface.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py |
index 86a596357364db32414d96e8a80093241c956745..be1006d82c284885c32fb45e21b776c0bdf1a811 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py |
+++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py |
@@ -291,10 +291,19 @@ def interface_context(interface, interfaces): |
number_of_required_arguments(constructor), |
} for constructor in interface.custom_constructors] |
+ # [HTMLConstructor] |
+ html_constructor = 'HTMLConstructor' in extended_attributes |
bashi
2016/10/04 06:44:46
nit: html_constructor -> has_html_constructor ?
|
+ if html_constructor: |
+ # https://html.spec.whatwg.org/#html-element-constructors |
Yuki
2016/10/04 06:51:05
nit: https://html.spec.whatwg.org/multipage/dom.ht
|
+ if ('Constructor' in extended_attributes) or ('NoInterfaceObject' in extended_attributes): |
bashi
2016/10/04 06:44:46
nit: It seems that you can drop ('Constructor' in
|
+ raise Exception('[Constructor] and [NoInterfaceObject] MUST NOT be' |
+ ' specified with [HTMLConstructor]: ' |
+ '%s' % interface.name) |
+ |
# [NamedConstructor] |
named_constructor = named_constructor_context(interface) |
- if constructors or custom_constructors or named_constructor: |
+ if constructors or custom_constructors or html_constructor or named_constructor: |
if interface.is_partial: |
raise Exception('[Constructor] and [NamedConstructor] MUST NOT be' |
' specified on partial interface definitions: ' |
@@ -330,6 +339,7 @@ def interface_context(interface, interfaces): |
context.update({ |
'constructors': constructors, |
'has_custom_constructor': bool(custom_constructors), |
+ 'has_html_constructor': bool(html_constructor), |
bashi
2016/10/04 06:44:46
nit: |html_constructor| is already a bool value so
|
'interface_length': |
interface_length(constructors + custom_constructors), |
'is_constructor_raises_exception': extended_attributes.get('RaisesException') == 'Constructor', # [RaisesException=Constructor] |