blob: 9a89f888ecd6738e93151052453163209777bd97 [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.
* @assertion
* @description
import "dart:html";
import "../../testharness.dart";
import "../../../Utils/expect.dart";
const String htmlEL2 = r'''
<p>This tests that when nodes are foster-parented after being adopted into another document,
they are adopted back into the ownerDocument of their foster parent. </p>
const String htmlEL3 = r'''
<div id=fosterChild></div>
void main() {
document.body.appendHtml(htmlEL2, treeSanitizer: new NullTreeSanitizer());
document.body.appendHtml(htmlEL3, treeSanitizer: new NullTreeSanitizer());
var doc = document.implementation.createHtmlDocument("");
var div = document.createElement('div');
var t=document.querySelector('table');
var fosterChild = div.querySelector('#fosterChild');
Expect.equals(fosterChild.ownerDocument, fosterChild.parentNode.ownerDocument);