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

Unified Diff: lib/html/scripts/systemhtml.py

Issue 11026039: Refactor idl to dart renaming logic for interfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemhtml.py
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index bd32a3ed58aa2e8ab713d6448cfb21214114608d..6fe6ab7f91b2287e214b93c5be126574ba7309cd 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -84,7 +84,7 @@ class ElementConstructorInfo(object):
_html_element_constructors = {
'AnchorElement' :
- ElementConstructorInfo(tag='a', opt_params=[('String', 'href')]),
+ ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]),
'AreaElement': 'area',
'ButtonElement': 'button',
'BRElement': 'br',
@@ -114,10 +114,10 @@ _html_element_constructors = {
'IFrameElement': 'iframe',
'ImageElement':
ElementConstructorInfo(tag='img',
- opt_params=[('String', 'src'),
+ opt_params=[('DOMString', 'src'),
('int', 'width'), ('int', 'height')]),
'InputElement':
- ElementConstructorInfo(tag='input', opt_params=[('String', 'type')]),
+ ElementConstructorInfo(tag='input', opt_params=[('DOMString', 'type')]),
'KeygenElement': 'keygen',
'LIElement': 'li',
'LabelElement': 'label',
@@ -166,7 +166,7 @@ def HtmlElementConstructorInfos(typename):
return infos
def EmitHtmlElementFactoryConstructors(emitter, infos, typename, class_name,
- dart_type):
+ rename_type):
for info in infos:
constructor_info = info.ConstructorInfo(typename)
@@ -177,11 +177,11 @@ def EmitHtmlElementFactoryConstructors(emitter, infos, typename, class_name,
'$!INITS'
' return _e;\n'
' }\n',
- RETURN_TYPE=constructor_info.type_name,
- CONSTRUCTOR=constructor_info.ConstructorFactoryName(dart_type),
+ RETURN_TYPE=rename_type(constructor_info.type_name),
+ CONSTRUCTOR=constructor_info.ConstructorFactoryName(rename_type),
CLASS=class_name,
TAG=info.tag,
- PARAMS=constructor_info.ParametersInterfaceDeclaration(dart_type))
+ PARAMS=constructor_info.ParametersInterfaceDeclaration(rename_type))
for param in constructor_info.param_infos:
inits.Emit(' if ($E != null) _e.$E = $E;\n', E=param.name)
@@ -282,12 +282,12 @@ class HtmlDartInterfaceGenerator(object):
EmitHtmlElementFactoryConstructors(
self._library_emitter.FileEmitter('_Elements', template),
infos,
- self._html_interface_name,
+ self._interface.id,
self._backend.ImplementationClassName(),
self._DartType)
for info in infos:
- constructors.append(info.ConstructorInfo(typename))
+ constructors.append(info.ConstructorInfo(self._interface.id))
if factory_provider:
assert factory_provider == info.factory_provider_name
else:
@@ -900,7 +900,7 @@ class Dart2JSBackend(object):
(stmts_emitter, call_emitter) = body.Emit('$!A$!B', INDENT=' ');
method_version[0] += 1
- target = '_%s_%d' % (html_name, method_version[0])
+ target = '_%s_%d' % (html_name, method_version[0]);
arguments = []
target_parameters = []
for position, arg in enumerate(operation.arguments[:argument_count]):
@@ -1042,6 +1042,8 @@ class Dart2JSBackend(object):
return False
def _NarrowToImplementationType(self, type_name):
+ if type_name == 'Dynamic':
+ return type_name
if self._ShouldNarrowToImplementationType(type_name):
return self._ImplClassName(self._DartType(type_name))
return self._DartType(type_name)
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698