Bug 27845

Summary: document.compatMode is incorrect for javascript: protocol URLs in IFRAMEs
Product: WebKit Reporter: haysfamily
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, commit-queue, marcoos+bwo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
tiny HTML file that shows the correct compatMode with no DOCTYPE in the main document, and then incorrectly set for the IFRAME
none
Patch none

Description haysfamily 2009-07-30 11:50:38 PDT
Created attachment 33797 [details]
tiny HTML file that shows the correct compatMode with no DOCTYPE in the main document, and then incorrectly set for the IFRAME

When you specify a src="javascript:'<HTML><BODY></BODY></HTML>'" attribute for an IFRAME, WebKit assigns document.compatMode = CSS1Compat (strict) even though no DOCTYPE was specified.  All other browsers tested (IE 6, 7, 8, Firefox 2, 3, 3.5, Opera 9.6x) report the compatMode = BackCompat (quirks).
Comment 1 Marek Stepien 2011-03-10 06:37:08 PST
This does not happen in recent WebKit nightlies and Chrome 10.

It is reproducible on Safari 5, though (I only checked on Windows).
Comment 2 Alexey Proskuryakov 2011-03-10 10:52:27 PST
Fixed by HTML5 parser? Do we need a regression test?
Comment 3 Adam Barth 2011-03-10 11:28:19 PST
I'll write a test.
Comment 4 Adam Barth 2011-03-10 12:33:35 PST
Created attachment 85370 [details]
Patch
Comment 5 Alexey Proskuryakov 2011-03-10 12:42:30 PST
Comment on attachment 85370 [details]
Patch

It's better when tests mention what expected results are, and why (a link to a bug would be nice). That makes it much easier to decide what to do when results unexpectedly change.
Comment 6 WebKit Commit Bot 2011-03-10 23:24:31 PST
Comment on attachment 85370 [details]
Patch

Clearing flags on attachment: 85370

Committed r80821: <http://trac.webkit.org/changeset/80821>
Comment 7 WebKit Commit Bot 2011-03-10 23:24:37 PST
All reviewed patches have been landed.  Closing bug.