New issue
Advanced search Search tips

Issue 731238 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Popuplating a new document using open()/close() but not write() always results in compatMode='BackCompat'

Project Member Reported by efernandez@google.com, Jun 8 2017

Issue description

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 2 by rbyers@chromium.org, Jun 16 2017

Components: Blink>DOM
I agree this seems surprising, but current versions of Chrome, Firefox, Edge and Safari all seem to share this behavior so it's likely per-spec (and we probably wouldn't want to change unless the other browsers agree to change as well).  To the DOM team.
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 13 2017

Labels: Hotlist-Google
Status: WontFix (was: Untriaged)
This is correct per spec. Only the parser has the ability to set something to no-quirks mode (compatMode = CSS1Compat). document.write() invokes the parser, but simply inserting a doctype does not.

Sign in to add a comment