Index: tools/dom/scripts/htmldartgenerator.py |
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py |
index 29b757f9d84bfbdecdf0dfa24c00b98f2e61f62f..607a75694feea0721187eb46b693b24762cf9037 100644 |
--- a/tools/dom/scripts/htmldartgenerator.py |
+++ b/tools/dom/scripts/htmldartgenerator.py |
@@ -107,11 +107,28 @@ class HtmlDartGenerator(object): |
convert_to_future_members): |
self.AddOperation(ConvertToFuture(info), declare_only) |
+ def _HoistableConstants(self, interface): |
+ consts = [] |
+ if interface.parents: |
+ for parent in interface.parents: |
+ parent_interface = self._database.GetInterface(parent.type.id) |
+ # TODO(vsm): This should be a general check. E.g., on private |
+ # interfaces? |
+ if parent.type.id == 'WebGLRenderingContextBase': |
+ consts = consts + parent_interface.constants |
+ return consts |
+ |
def AddSecondaryMembers(self, interface): |
# With multiple inheritance, attributes and operations of non-first |
# interfaces need to be added. Sometimes the attribute or operation is |
# defined in the current interface as well as a parent. In that case we |
# avoid making a duplicate definition and pray that the signatures match. |
+ if not self._renamer.ShouldSuppressInterface(interface): |
+ secondary_constants = sorted(self._HoistableConstants(interface), |
+ ConstantOutputOrder) |
+ for const in secondary_constants: |
+ self.AddConstant(const) |
+ |
secondary_parents = self._database.TransitiveSecondaryParents(interface, |
not self._dart_use_blink) |
for parent_interface in sorted(secondary_parents): |