| 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..12558c5107c52f218835e15d455b2f6296cce5ee 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)",
|
| + '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,12 @@ 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)
|
| +
|
| def EmitStaticFactory(self, constructor_info):
|
| arguments = constructor_info.ParametersAsArgumentList()
|
| if arguments:
|
|
|