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

Unified Diff: sdk/lib/html/scripts/systemhtml.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/systemhtml.py
diff --git a/sdk/lib/html/scripts/systemhtml.py b/sdk/lib/html/scripts/systemhtml.py
index ba8fa356bd80e3e659deb76fc4273e5fd75c1573..9c917ede72ee42d9e053a8fb26c723ea699284a5 100644
--- a/sdk/lib/html/scripts/systemhtml.py
+++ b/sdk/lib/html/scripts/systemhtml.py
@@ -66,6 +66,22 @@ _js_custom_members = set([
'WorkerContext.indexedDB',
])
+js_support_checks = {
+ 'HTMLContentElement': "Element.isTagSupported('content')",
+ 'HTMLDataListElement': "Element.isTagSupported('datalist')",
+ 'HTMLDetailsElement': "Element.isTagSupported('details')",
+ 'HTMLEmbedElement': "Element.isTagSupported('embed')",
+ # IE creates keygen as Block elements
+ 'HTMLKeygenElement': "Element.isTagSupported('keygen') "
+ "&& (new Element.tag('keygen') is KeygenElement)",
Emily Fortuna 2012/12/27 23:06:49 can we programmatically determine for which classe
blois 2012/12/28 00:43:27 isTagSupported checks if the browser treats it as
+ 'HTMLMarqueeElement': "Element.isTagSupported('marquee')"
+ "&& (new Element.tag('marquee') is MarqueeElement)",
+ 'HTMLMeterElement': "Element.isTagSupported('meter')",
+ 'HTMLObjectElement': "Element.isTagSupported('object')",
+ 'HTMLOutputElement': "Element.isTagSupported('output')",
+ 'HTMLProgressElement': "Element.isTagSupported('progress')",
+ 'HTMLTrackElement': "Element.isTagSupported('track')",
+}
# Classes that offer only static methods, and therefore we should suppress
# constructor creation.
@@ -390,6 +406,8 @@ class HtmlDartInterfaceGenerator(object):
self._backend.AddConstructors(
constructors, factory_provider, factory_constructor_name)
+ self._backend.EmitSupportCheck()
+
events_class_name = self._event_generator.ProcessInterface(
self._interface, interface_name,
self._backend.CustomJSMembers(),
@@ -469,6 +487,13 @@ class Dart2JSBackend(HtmlDartGenerator):
def FinishInterface(self):
pass
+ def HasSupportCheck(self):
+ return self._interface.doc_js_name in js_support_checks
+
+ def GetSupportCheck(self):
+ return js_support_checks.get(self._interface.doc_js_name)
+
+
Emily Fortuna 2012/12/27 23:06:49 remove extra newline
blois 2012/12/28 00:43:27 Done.
def EmitStaticFactory(self, constructor_info):
arguments = constructor_info.ParametersAsArgumentList()
if arguments:

Powered by Google App Engine
This is Rietveld 408576698