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

Unified Diff: sdk/lib/html/scripts/htmldartgenerator.py

Issue 11293292: Add constructors for SVG elements and remove static factory providers for html elements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/html/scripts/generator.py ('k') | sdk/lib/html/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/scripts/htmldartgenerator.py
===================================================================
--- sdk/lib/html/scripts/htmldartgenerator.py (revision 14920)
+++ sdk/lib/html/scripts/htmldartgenerator.py (working copy)
@@ -182,17 +182,21 @@
implements.append('List<%s>' % item_type_info.dart_type())
return implements
- def AddConstructors(self, constructors, factory_provider, class_name,
- base_class):
+ def AddConstructors(self, constructors, factory_name, class_name,
+ base_class, factory_constructor_name=None):
""" Adds all of the constructors.
Arguments:
constructors - List of the constructors to be added.
- factory_provider - Name of the factory provider for this class.
+ factory_name - Name of the factory for this class.
class_name - The name of this class.
base_class - The name of the base class which this extends.
+ factory_constructor_name - The name of the constructor on the
+ factory_name to call (calls an autogenerated FactoryProvider
+ if unspecified)
"""
for constructor_info in constructors:
- self._AddConstructor(constructor_info, factory_provider)
+ self._AddConstructor(constructor_info, factory_name,
+ factory_constructor_name, constructor_info.factory_parameters)
typed_array_type = None
for interface in self._database.Hierarchy(self._interface):
@@ -214,11 +218,14 @@
' $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n',
CTOR=self._interface.id,
TYPE=self._DartType(typed_array_type),
- FACTORY=factory_provider)
+ FACTORY=factory_name)
- def _AddConstructor(self, constructor_info, factory_provider):
- constructor_info.GenerateFactoryInvocation(
- self._DartType, self._members_emitter, factory_provider)
+ def _AddConstructor(self, constructor_info, factory_name,
+ factory_constructor_name, factory_constructor_params):
+ constructor_info.GenerateFactoryInvocation(
+ self._DartType, self._members_emitter, factory_name,
+ factory_constructor_name=factory_constructor_name,
+ factory_parameters=factory_constructor_params)
def DeclareAttribute(self, attribute, type_name, attr_name, read_only):
""" Declares an attribute but does not include the code to invoke it.
« no previous file with comments | « sdk/lib/html/scripts/generator.py ('k') | sdk/lib/html/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698