Bug 159489 - iframe srcdoc with quirky doctype should be no-quirks mode
Summary: iframe srcdoc with quirky doctype should be no-quirks mode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-06 13:51 PDT by Simon Pieters (:zcorpan)
Modified: 2022-08-11 02:15 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.