Index: tools/dom/templates/html/impl/impl_Document.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate |
index d803f8e783d43ee32eacb9a84da34b4f6e9f0b1d..fb6d6b1889059268f5cada3b37301a8fb03ecddd 100644 |
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate |
@@ -64,7 +64,11 @@ $endif |
@DomName('Document.createElement') |
Element createElement(String tagName, [String typeExtension]) { |
$if DART2JS |
- return _createElement(tagName, typeExtension); |
+ if (typeExtension == null) { |
+ return _createElement_2(tagName); |
+ } else { |
+ return _createElement(tagName, typeExtension); |
+ } |
$else |
var newElement = (typeExtension == null) ? |
_blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) : |
@@ -86,18 +90,35 @@ $else |
$endif |
} |
+$if DART2JS |
+ // 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); |
+ |
+$endif |
@DomName('Document.createElementNS') |
@DocsEditable() |
Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) { |
$if DART2JS |
- return _createElementNS(namespaceURI, qualifiedName, typeExtension); |
+ if (typeExtension == null) { |
+ return _createElementNS_2(namespaceURI, qualifiedName); |
+ } else { |
+ return _createElementNS(namespaceURI, qualifiedName, typeExtension); |
+ } |
$else |
var newElement = (typeExtension == null) ? |
_blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this), namespaceURI, qualifiedName) : |
_blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension); |
- |
+ |
var wrapped; |
- |
+ |
if (newElement['dart_class'] != null) { |
wrapped = newElement['dart_class']; // Here's our Dart class. |
wrapped.blink_jsObject = newElement; |
@@ -107,7 +128,7 @@ $else |
wrapped = wrap_jso_custom_element(newElement); |
} |
} |
- |
+ |
return wrapped; |
$endif |
} |