Bug 159489

Summary: iframe srcdoc with quirky doctype should be no-quirks mode
Product: WebKit Reporter: Simon Pieters (:zcorpan) <zcorpan>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, cdumez, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Pieters (:zcorpan) 2016-07-06 13:51:39 PDT
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4303

<iframe srcdoc="<!doctype x>">

The srcdoc document should always be in no-quirks mode, regardless of the doctype. In WebKit if there's a quirky doctype it triggers quirks mode.

https://html.spec.whatwg.org/multipage/syntax.html#the-initial-insertion-mode
Comment 1 Ahmad Saleem 2022-08-08 16:54:18 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case, where it shows "BackCompat" mode for Safari in logs, while CSS1Compat mode for Firefox Nightly 105 and Chrome Canary 106. Thanks!
Comment 2 Ahmad Saleem 2022-08-08 16:55:43 PDT
*** Safari 15.6 on macOS 12.5 ***

log: BackCompat
rendering mode: CSS1Compat
document has no title

*** Firefox Nightly 105 ***

log: CSS1Compat
rendering mode: CSS1Compat
document has no title

*** Chrome Canary 106 ***

log: CSS1Compat
rendering mode: CSS1Compat
document has no title
Comment 3 Radar WebKit Bug Importer 2022-08-10 11:05:54 PDT
<rdar://problem/98460686>
Comment 4 Ryosuke Niwa 2022-08-10 12:15:43 PDT
Oh, we have a check for this in HTMLConstructionSite::setDefaultCompatibilityMode() but we're missing one in HTMLConstructionSite::setCompatibilityModeFromDoctype
Comment 5 Ryosuke Niwa 2022-08-10 13:10:20 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3199
Comment 6 EWS 2022-08-11 02:15:38 PDT
Committed 253326@main (4401d4e5b5d9): <https://commits.webkit.org/253326@main>

Reviewed commits have been landed. Closing PR #3199 and removing active labels.