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

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

Issue 11679007: Adding support checks for partially supported element types and updating tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removing duplicated contentelement_test. Created 8 years 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
Index: sdk/lib/html/scripts/htmldartgenerator.py
diff --git a/sdk/lib/html/scripts/htmldartgenerator.py b/sdk/lib/html/scripts/htmldartgenerator.py
index ff4eb7210c6a95aa13a19284f81b2e532b592e4d..42be19a6758a34c5031646f8ed74f93bcef484b3 100644
--- a/sdk/lib/html/scripts/htmldartgenerator.py
+++ b/sdk/lib/html/scripts/htmldartgenerator.py
@@ -20,6 +20,7 @@ _secure_base_types = {
'History': 'HistoryBase',
}
+
class HtmlDartGenerator(object):
def __init__(self, interface, options):
self._database = options.database
@@ -28,6 +29,16 @@ class HtmlDartGenerator(object):
self._interface_type_info = self._type_registry.TypeInfo(self._interface.id)
self._renamer = options.renamer
+ def EmitSupportCheck(self):
+ if self.HasSupportCheck():
+ support_check = self.GetSupportCheck()
+ self._members_emitter.Emit('\n'
+ ' /**\n'
+ ' * Checks if this type is supported on the current platform\n'
+ ' */\n'
+ ' static bool get supported => $SUPPORT_CHECK;\n',
+ SUPPORT_CHECK=support_check)
+
def EmitAttributeDocumentation(self, attribute):
""" Emits the MDN dartdoc comment for an attribute.
"""

Powered by Google App Engine
This is Rietveld 408576698