Chrome Version: (copy from chrome://version)
OS: (e.g. Win7, OSX 10.9.5, etc...)
What steps will reproduce the problem?
(1) Call document.open() to clear out the document(2)
(2) Append a <!DOCTYPE html> element using createDocumentType
(3) Call document.close()
What is the expected result?
document.compatMode should be "CSS1Compat"
What happens instead?
document.compatMode is "BackCompat"
Simple scripts to repro in dev console:
// Repro the issue
document.open();
document.appendChild(document.implementation.createDocumentType('html', '',''));
document.close();
console.log(document.compatMode);
// Does not repro, using document.write() to set the DOCTYPE instead.
document.open();
document.write('<!DOCTYPE html>');
document.close();
console.log(document.compatMode);
Comment 1 by efernandez@google.com
, Jun 8 2017