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

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

Issue 639593002: Add webgl constants back to correct class (Closed) Base URL: https://dart.googlecode.com/svn/trunk/dart
Patch Set: Created 6 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
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698