https://github.com/web-platform-tests/wpt
Revision 853a2443bf3cd041de125d802efd41548f87fe44 authored by Mike on 04 April 2018, 15:32:17 UTC, committed by Mike on 04 April 2018, 15:32:17 UTC
2 parent s b1352a6 + fe48ae8
Raw File
Tip revision: 853a2443bf3cd041de125d802efd41548f87fe44 authored by Mike on 04 April 2018, 15:32:17 UTC
Merge branch 'bfo-css-backgrounds-fix' of https://github.com/faceless2/web-platform-tests into bfo-css-backgrounds-fix
Tip revision: 853a244
DOMParser-parseFromString-xml-doctype.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>HTML entities for various XHTML Doctype variants</title>
<link rel=help href="http://w3c.github.io/html/xhtml.html#parsing-xhtml-documents">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
  test(function () {
    var doc = new DOMParser().parseFromString('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"><html><div id="test"/></html>', 'application/xhtml+xml');
    var div = doc.getElementById('test');
    assert_equals(div, null); // If null, then this was a an error document (didn't parse the input successfully)
  }, "Doctype parsing of System Id must fail on ommitted value");

  test(function () {
    var doc = new DOMParser().parseFromString('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""><html><div id="test"/></html>', 'application/xhtml+xml');
    var div = doc.getElementById('test');
    assert_not_equals(div, null); // If found, then the DOMParser didn't generate an error document
  }, "Doctype parsing of System Id can handle empty string");

  test(function () {
    var doc = new DOMParser().parseFromString('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "x"><html><div id="test"/></html>', 'application/xhtml+xml');
    var div = doc.getElementById('test');
    assert_not_equals(div, null);
  }, "Doctype parsing of System Id can handle a quoted value");

</script>
back to top