Chromium Code Reviews| Index: client/html/src/ElementWrappingImplementation.dart |
| diff --git a/client/html/src/ElementWrappingImplementation.dart b/client/html/src/ElementWrappingImplementation.dart |
| index 69daec26cbc8ae63c26ffae6648b2cf723a780d6..d82ad74a1b381ec27229ee016ef6b5d3d780d2aa 100644 |
| --- a/client/html/src/ElementWrappingImplementation.dart |
| +++ b/client/html/src/ElementWrappingImplementation.dart |
| @@ -540,17 +540,20 @@ class ElementWrappingImplementation extends NodeWrappingImplementation implement |
| var temp = dom.document.createElement(parentTag); |
| temp.innerHTML = html; |
| + var element; |
|
Jacob
2012/02/14 02:31:06
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 */ |