Chromium Code Reviews| Index: lib/dom/scripts/dartgenerator.py |
| diff --git a/lib/dom/scripts/dartgenerator.py b/lib/dom/scripts/dartgenerator.py |
| index 7e3d246ec89ce8dcb2be9c44ec308bb2091b3c2b..f22b8ca502bd361c3d044c0b67800e5d9be8d300 100755 |
| --- a/lib/dom/scripts/dartgenerator.py |
| +++ b/lib/dom/scripts/dartgenerator.py |
| @@ -351,7 +351,6 @@ class DartGenerator(object): |
| for system in self._systems: |
| system.Finish() |
| - |
| def _PreOrderInterfaces(self, interfaces): |
| """Returns the interfaces in pre-order, i.e. parents first.""" |
| seen = set() |
| @@ -394,7 +393,7 @@ class DartGenerator(object): |
| generator.AddConstant(const) |
| attributes = [attr for attr in interface.attributes |
| - if not self._IsEventAttribute(interface, attr)] |
| + if attr.type.id != 'EventListener'] |
| for (getter, setter) in _PairUpAttributes(attributes): |
| for generator in generators: |
| generator.AddAttribute(getter, setter) |
| @@ -452,12 +451,6 @@ class DartGenerator(object): |
| generator.FinishInterface() |
| return |
| - def _IsEventAttribute(self, interface, attr): |
| - # Remove EventListener attributes like 'onclick' when addEventListener |
| - # is available. |
| - return (attr.type.id == 'EventListener' and |
| - 'EventTarget' in self._AllImplementedInterfaces(interface)) |
| - |
| def _TransitiveSecondaryParents(self, interface): |
| """Returns a list of all non-primary parents. |
| @@ -518,6 +511,13 @@ class DartGenerator(object): |
| self._inheritance_closure = {} |
| for interface in self._database.GetInterfaces(): |
| + # Create fake EventTarget parent interface for interfaces that have |
|
sra1
2012/04/12 15:56:17
I think it would be best to move this fixing to a
|
| + # 'EventTarget' extended attribute. |
| + if 'EventTarget' in interface.ext_attrs: |
| + ast = [('Annotation', [('Id', 'WebKit')]), |
| + ('InterfaceType', ('ScopedName', 'EventTarget'))] |
| + interface.parents.append(idlnode.IDLParentInterface(ast)) |
| + |
| seen = set() |
| collected = [] |
| Collect(interface, seen, collected) |