blob: 6e08f76aaa48b0b8522faf7cb3be5075e2963c8b [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 On setting document.title to the empty string, no text node
* must be created
import "dart:html";
import "../../testcommon.dart";
main() {
var doc = new DomParser().parseFromString('''
<!DOCTYPE html>
<title>document title and the empty string</title>
''', 'text/html');
var head = doc.documentElement.firstChild;
head.firstChild.remove(); // remove title
shouldBeEqualToString(doc.title, "");
doc.title = "";
shouldBeEqualToString(doc.title, "");
shouldBeTrue(head.lastChild is TitleElement);
shouldBe(head.lastChild.firstChild, null);