| Index: sdk/lib/html/dart2js/html_dart2js.dart
|
| diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
|
| index cf7cea00349c5569d2789b1746cca2ee577d894f..b0a804ab9ad8a6ff1097d1fdbb8a7d042d6ddb5b 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -1457,11 +1457,18 @@ class Console {
|
|
|
|
|
| /// @domName HTMLContentElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME, '25')
|
| +@Experimental()
|
| class ContentElement extends Element native "*HTMLContentElement" {
|
|
|
| ///@docsEditable true
|
| factory ContentElement() => document.$dom_createElement("content");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('content');
|
| +
|
| /// @domName HTMLContentElement.resetStyleInheritance; @docsEditable true
|
| bool resetStyleInheritance;
|
|
|
| @@ -5279,11 +5286,20 @@ class DListElement extends Element native "*HTMLDListElement" {
|
|
|
|
|
| /// @domName HTMLDataListElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.FIREFOX)
|
| +@SupportedBrowser(SupportedBrowser.IE, '10')
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class DataListElement extends Element native "*HTMLDataListElement" {
|
|
|
| ///@docsEditable true
|
| factory DataListElement() => document.$dom_createElement("datalist");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('datalist');
|
| +
|
| /// @domName HTMLDataListElement.options; @docsEditable true
|
| final HtmlCollection options;
|
| }
|
| @@ -5500,11 +5516,19 @@ class DedicatedWorkerContextEvents extends WorkerContextEvents {
|
|
|
|
|
| /// @domName HTMLDetailsElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| +@Experimental()
|
| class DetailsElement extends Element native "*HTMLDetailsElement" {
|
|
|
| ///@docsEditable true
|
| factory DetailsElement() => document.$dom_createElement("details");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('details');
|
| +
|
| /// @domName HTMLDetailsElement.open; @docsEditable true
|
| bool open;
|
| }
|
| @@ -7372,6 +7396,10 @@ abstract class Element extends Node implements ElementTraversal native "*Element
|
| *
|
| * For standard elements it is more preferable to use the type constructors:
|
| * var element = new DivElement();
|
| + *
|
| + * See also:
|
| + *
|
| + * * [isTagSupported]
|
| */
|
| factory Element.tag(String tag) =>
|
| _ElementFactoryProvider.createElement_tag(tag);
|
| @@ -7585,6 +7613,16 @@ abstract class Element extends Node implements ElementTraversal native "*Element
|
| this.insertAdjacentHtml('beforeend', text);
|
| }
|
|
|
| + /**
|
| + * Checks to see if the tag name is supported by the current platform.
|
| + *
|
| + * The tag should be a valid HTML tag name.
|
| + */
|
| + static bool isTagSupported(String tag) {
|
| + var e = _ElementFactoryProvider.createElement_tag(tag);
|
| + return e is Element && !(e is UnknownElement);
|
| + }
|
| +
|
| // Hooks to support custom WebComponents.
|
| /**
|
| * Experimental support for [web components][wc]. This field stores a
|
| @@ -7981,7 +8019,7 @@ class _ElementFactoryProvider {
|
| /** @domName Document.createElement */
|
| // Optimization to improve performance until the dart2js compiler inlines this
|
| // method.
|
| - static Element createElement_tag(String tag) =>
|
| + static dynamic createElement_tag(String tag) =>
|
| JS('Element', 'document.createElement(#)', tag);
|
| }
|
| // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| @@ -8170,11 +8208,19 @@ abstract class ElementTraversal {
|
|
|
|
|
| /// @domName HTMLEmbedElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.IE)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class EmbedElement extends Element native "*HTMLEmbedElement" {
|
|
|
| ///@docsEditable true
|
| factory EmbedElement() => document.$dom_createElement("embed");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('embed');
|
| +
|
| /// @domName HTMLEmbedElement.align; @docsEditable true
|
| String align;
|
|
|
| @@ -11944,11 +11990,19 @@ class KeyboardEvent extends UIEvent native "*KeyboardEvent" {
|
|
|
|
|
| /// @domName HTMLKeygenElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| +@Experimental()
|
| class KeygenElement extends Element native "*HTMLKeygenElement" {
|
|
|
| ///@docsEditable true
|
| factory KeygenElement() => document.$dom_createElement("keygen");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('keygen') && (new Element.tag('keygen') is KeygenElement);
|
| +
|
| /// @domName HTMLKeygenElement.autofocus; @docsEditable true
|
| bool autofocus;
|
|
|
| @@ -12174,6 +12228,11 @@ class MapElement extends Element native "*HTMLMapElement" {
|
| /// @domName HTMLMarqueeElement; @docsEditable true
|
| class MarqueeElement extends Element native "*HTMLMarqueeElement" {
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('marquee')&& (new Element.tag('marquee') is MarqueeElement);
|
| +
|
| /// @domName HTMLMarqueeElement.behavior; @docsEditable true
|
| String behavior;
|
|
|
| @@ -13058,11 +13117,19 @@ typedef void MetadataCallback(Metadata metadata);
|
|
|
|
|
| /// @domName HTMLMeterElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.FIREFOX)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class MeterElement extends Element native "*HTMLMeterElement" {
|
|
|
| ///@docsEditable true
|
| factory MeterElement() => document.$dom_createElement("meter");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('meter');
|
| +
|
| /// @domName HTMLMeterElement.high; @docsEditable true
|
| num high;
|
|
|
| @@ -14288,11 +14355,19 @@ class OListElement extends Element native "*HTMLOListElement" {
|
|
|
|
|
| /// @domName HTMLObjectElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.FIREFOX)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class ObjectElement extends Element native "*HTMLObjectElement" {
|
|
|
| ///@docsEditable true
|
| factory ObjectElement() => document.$dom_createElement("object");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('object');
|
| +
|
| /// @domName HTMLObjectElement.align; @docsEditable true
|
| String align;
|
|
|
| @@ -14498,11 +14573,19 @@ class OptionElement extends Element native "*HTMLOptionElement" {
|
|
|
|
|
| /// @domName HTMLOutputElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.FIREFOX)
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class OutputElement extends Element native "*HTMLOutputElement" {
|
|
|
| ///@docsEditable true
|
| factory OutputElement() => document.$dom_createElement("output");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('output');
|
| +
|
| /// @domName HTMLOutputElement.defaultValue; @docsEditable true
|
| String defaultValue;
|
|
|
| @@ -14852,11 +14935,20 @@ class ProcessingInstruction extends Node native "*ProcessingInstruction" {
|
|
|
|
|
| /// @domName HTMLProgressElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.FIREFOX)
|
| +@SupportedBrowser(SupportedBrowser.IE, '10')
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class ProgressElement extends Element native "*HTMLProgressElement" {
|
|
|
| ///@docsEditable true
|
| factory ProgressElement() => document.$dom_createElement("progress");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('progress');
|
| +
|
| /// @domName HTMLProgressElement.labels; @docsEditable true
|
| @Returns('NodeList') @Creates('NodeList')
|
| final List<Node> labels;
|
| @@ -17817,11 +17909,19 @@ class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
|
|
|
|
|
| /// @domName HTMLTrackElement; @docsEditable true
|
| +@SupportedBrowser(SupportedBrowser.CHROME)
|
| +@SupportedBrowser(SupportedBrowser.IE, '10')
|
| +@SupportedBrowser(SupportedBrowser.SAFARI)
|
| class TrackElement extends Element native "*HTMLTrackElement" {
|
|
|
| ///@docsEditable true
|
| factory TrackElement() => document.$dom_createElement("track");
|
|
|
| + /**
|
| + * Checks if this type is supported on the current platform
|
| + */
|
| + static bool get supported => Element.isTagSupported('track');
|
| +
|
| static const int ERROR = 3;
|
|
|
| static const int LOADED = 2;
|
|
|