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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.py

Issue 2385073002: HTMLConstructor implementation (Closed)
Patch Set: Renamed V8HTMLElement constructor to HTMLConstructor Created 4 years, 2 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: 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..c0787d51f66134c8c652bdfafe80c24963e010cf 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]
+ has_html_constructor = 'HTMLConstructor' in extended_attributes
+ # https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
+ if has_html_constructor:
+ if ('Constructor' in extended_attributes) or ('NoInterfaceObject' in extended_attributes):
+ 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 has_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': has_html_constructor,
'interface_length':
interface_length(constructors + custom_constructors),
'is_constructor_raises_exception': extended_attributes.get('RaisesException') == 'Constructor', # [RaisesException=Constructor]

Powered by Google App Engine
This is Rietveld 408576698