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 15fe25452613f8a368e953d3b0db3eac6f796d27..ece22d30944a33fa4abd59eb2bd24f11f3823bfd 100644 |
--- a/sdk/lib/html/dart2js/html_dart2js.dart |
+++ b/sdk/lib/html/dart2js/html_dart2js.dart |
@@ -9834,13 +9834,32 @@ class Document extends Node |
@DomName('Document.createElement') |
Element createElement(String tagName, [String typeExtension]) { |
- return _createElement(tagName, typeExtension); |
+ if (typeExtension == null) { |
+ return _createElement_2(tagName); |
+ } else { |
+ return _createElement(tagName, typeExtension); |
+ } |
} |
+ // The two-argument version of this is automatically generated, but we need to |
+ // omit the typeExtension if it's null on Firefox or we get an is="null" attribute. |
+ @DomName('Document.createElement') |
+ _createElement_2(String tagName) => JS('', '#.createElement(#)', this, tagName); |
+ |
+ // The three-argument version of this is automatically generated, but we need to |
+ // omit the typeExtension if it's null on Firefox or we get an is="null" attribute. |
+ @DomName('Document.createElementNS') |
+ _createElementNS_2(String namespaceURI, String qualifiedName) => |
+ JS('', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName); |
+ |
@DomName('Document.createElementNS') |
@DocsEditable() |
Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) { |
- return _createElementNS(namespaceURI, qualifiedName, typeExtension); |
+ if (typeExtension == null) { |
+ return _createElementNS_2(namespaceURI, qualifiedName); |
+ } else { |
+ return _createElementNS(namespaceURI, qualifiedName, typeExtension); |
+ } |
} |
@DomName('Document.createNodeIterator') |