Bug 27845 - document.compatMode is incorrect for javascript: protocol URLs in IFRAMEs
Summary: document.compatMode is incorrect for javascript: protocol URLs in IFRAMEs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 11:50 PDT by haysfamily
Modified: 2011-03-10 23:24 PST (History)
4 users (show)

See Also:


Attachments
tiny HTML file that shows the correct compatMode with no DOCTYPE in the main document, and then incorrectly set for the IFRAME (503 bytes, text/html)
2009-07-30 11:50 PDT, haysfamily
no flags Details
Patch (1.63 KB, patch)
2011-03-10 12:33 PST, Adam Barth
no flags Details | Formatted Diff | Diff

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