| Index: client/html/release/htmlimpl.dart
|
| diff --git a/client/html/release/htmlimpl.dart b/client/html/release/htmlimpl.dart
|
| index 39644f521d890253ce78c2edec903ca85efe1d40..e908071db77db9491b3e73f7f0b77d05b608cdbd 100644
|
| --- a/client/html/release/htmlimpl.dart
|
| +++ b/client/html/release/htmlimpl.dart
|
| @@ -22726,17 +22726,20 @@ class ElementWrappingImplementation extends NodeWrappingImplementation implement
|
| var temp = dom.document.createElement(parentTag);
|
| temp.innerHTML = html;
|
|
|
| + var element;
|
| if (temp.childElementCount == 1) {
|
| - return LevelDom.wrapElement(temp.firstElementChild);
|
| + element = LevelDom.wrapElement(temp.firstElementChild);
|
| } else if (parentTag == 'html' && temp.childElementCount == 2) {
|
| // Work around for edge case in WebKit and possibly other browsers where
|
| // both body and head elements are created even though the inner html
|
| // only contains a head or body element.
|
| - return LevelDom.wrapElement(temp.children.item(tag == 'head' ? 0 : 1));
|
| + element = LevelDom.wrapElement(temp.children.item(tag == 'head' ? 0 : 1));
|
| } else {
|
| throw new IllegalArgumentException('HTML had ${temp.childElementCount} ' +
|
| 'top level elements but 1 expected');
|
| }
|
| + element.remove();
|
| + return element;
|
| }
|
|
|
| /** @domName Document.createElement */
|
| @@ -24208,7 +24211,7 @@ class SVGElementWrappingImplementation extends ElementWrappingImplementation imp
|
| }
|
|
|
| parentTag.innerHTML = svg;
|
| - if (parentTag.elements.length == 1) return parentTag.elements[0];
|
| + if (parentTag.elements.length == 1) return parentTag.nodes.removeLast();
|
|
|
| throw new IllegalArgumentException('SVG had ${parentTag.elements.length} ' +
|
| 'top-level elements but 1 expected');
|
|
|