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

Unified Diff: tools/dom/scripts/dartgenerator.py

Issue 22507005: EventTargets should be EventTargets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment line Created 7 years, 4 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
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/dartgenerator.py
diff --git a/tools/dom/scripts/dartgenerator.py b/tools/dom/scripts/dartgenerator.py
index 58ce4f61094bd1efcf1e1128a0d4ad112af07d11..cde0484d172bf888fec95189283fb1ba6b678da2 100755
--- a/tools/dom/scripts/dartgenerator.py
+++ b/tools/dom/scripts/dartgenerator.py
@@ -200,11 +200,25 @@ class DartGenerator(object):
visit(interface)
return ordered
+ def IsEventTarget(self, database, interface):
+ if interface.id == 'EventTarget':
+ return True
+ for parent in interface.parents:
+ parent_name = parent.type.id
+ if database.HasInterface(parent_name):
+ parent_interface = database.GetInterface(parent.type.id)
+ if self.IsEventTarget(database, parent_interface):
+ return True
+ return False
+
def FixEventTargets(self, database):
for interface in database.GetInterfaces():
- # Create fake EventTarget parent interface for interfaces that have
- # 'EventTarget' extended attribute.
- if 'EventTarget' in interface.ext_attrs and interface.id != 'EventTarget':
+ if self.IsEventTarget(database, interface):
+ # Add as an attribute for easy querying in generation code.
+ interface.ext_attrs['EventTarget'] = None
+ elif 'EventTarget' in interface.ext_attrs:
+ # Create fake EventTarget parent interface for interfaces that have
+ # 'EventTarget' extended attribute.
ast = [('Annotation', [('Id', 'WebKit')]),
('InterfaceType', ('ScopedName', 'EventTarget'))]
interface.parents.append(idlnode.IDLParentInterface(ast))
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698