blob: 831507108d85e31bc3f8975c152e9083df77688d [file] [log] [blame]
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
* @description
import "dart:html";
import "../../testcommon.dart";
main() {
var doc = new DomParser()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="" xml:lang="en">
<div id="container">
<p>This is a simple test of both importNode and cloneNode, created from an example that demonstrated a bug in importNode.</p>
<div style="background: yellow;">The original node:</div>
<div id="original" style="background: #7F7FFF; padding: 3px">Outer bit<div style="color: yellow; background: blue; margin: 3px;">Inner bit.</div></div>
<div style="background: yellow;">Copied with importNode():</div>
<div id="cloneTitle" style="background: yellow;">Copied with cloneNode():</div>
''', 'text/xml');
var imported = doc.getElementById('container')
.insertBefore(doc.importNode(doc.getElementById('original'), true), doc.getElementById('cloneTitle'));
var cloned = doc.getElementById('container')
shouldBe(imported.getAttribute('style'), 'background: #7F7FFF; padding: 3px');
shouldBe(cloned.getAttribute('style'), 'background: #7F7FFF; padding: 3px');