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

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

Issue 2385073002: HTMLConstructor implementation (Closed)
Patch Set: Move V8HTMLConstructor.cpp outside of 'custom' dir, spelling error fix 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..21b2c83384165752ab67d3c6d837599067ed26b8 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
+ if html_constructor:
+ # https://html.spec.whatwg.org/#html-element-constructors
+ 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 html_constructor or named_constructor:
if interface.is_partial:
raise Exception('[Constructor] and [NamedConstructor] MUST NOT be'
' specified on partial interface definitions: '
@@ -329,6 +338,7 @@ def interface_context(interface, interfaces):
context.update({
'constructors': constructors,
+ 'has_html_constructor': bool(html_constructor),
haraken 2016/10/03 06:13:04 Alphabetical order.
'has_custom_constructor': bool(custom_constructors),
'interface_length':
interface_length(constructors + custom_constructors),

Powered by Google App Engine
This is Rietveld 408576698