blob: a4bec30102fb3ef78be5269359ea96945e190986 [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 final Document ownerDocument
* The document this node belongs to.
* @description Checks ownerDocument of nested elements.
*/
import "dart:html";
import "../../../Utils/expect.dart";
main() {
var x = document.body;
if (x != null) {
x.innerHtml = '<div><button>foo</button></div>';
Expect.equals(document, x.ownerDocument, 'nest1');
Expect.equals(document, x.firstChild?.ownerDocument, 'nest2');
Expect.equals(document, x.firstChild?.firstChild?.ownerDocument, 'nest3');
} else {
Expect.fail("Body is null");
}
}