Run quirks mode in one frame and standards mode in another? - html

I have an old application that uses frames (not iframes) was was written back in the IE6 days so it runs in quirks mode.
Is it possible (Using IE 7 or 8) to have one frame still in quirks mode and another in standards mode or must the whole browser be in one mode or another?
I've been trying with no success.
I've seen this answer, that applies to iframes, but what about plain-old-frames?

I believe that you don't get the same option with frames as you do with an iframe. As the linked question's answer stated, the target in an iframe is not dependent upon the parent. In regular frames the pages all rely on the parent. I don't think you can separate the types out.

I'm not sure if this helps, but according to the Mozilla Dev center Firefox makes it's quirksmode decisions based on doctype only.
https://developer.mozilla.org/en/Mozilla's_DOCTYPE_sniffing
You'll notice using the old frameset doctype triggers "almost standards" mode, which could show up as quirksmode.

See my answer here for MSDN-documented solution for IE9: How to force Iframe to run quirks under a standard parent frame
In short, it is not possible to trigger quirks mode in a frame (or iframe) if the parent page is rendering in IE9 mode, but it is possible to trigger "quirks mode emulation" embedded in the IE9 rendering engine.
JSBin demo: http://jsbin.com/ozejuk/1/
Further reading: http://msdn.microsoft.com/en-us/library/gg558056(v=vs.85).aspx

If you can modify the code (or HTML) of the application, you can add a meta tag (just below head), so it forces IE to render it in Quirks mode, like this:
<meta http-equiv="X-UA-Compatible" content="IE=5">

Related

IE9 - Is it possible to have a child Frame render in Edge (HTML5) while parent Frames are in Quirks mode?

I am working on an web project that is a parent container unfortunately made up of several framesets / frames (I have no control over this). The overall document mode is Quirks, since several of the peripheral frames use non-standard doctypes. I am working on a page that is going to be used in one of the frames that needs to have HTML5 enabled (<!doctype html>). However, IE9 is commenting out the doctype in this frame, and rendering it in Quirks also.
Is there any way for me to force this particular frame to render in HTML5 standards mode, while the parent container is still in Quirks mode?
EDIT: I found this StackOverflow question from 2012: iframe not rendering in ie9 mode when containing page is in quirks mode. Is this still the only possible solution? I really don't want to use this solution as using an <object> tag makes it very hard to debug with F12 dev tools (all that will be seen is just the <object> tag, and not the HTML contained within it.
If a document is loaded in Quirks mode, all of its iframes will be as well. For more information, please see 2.1.2.3 iframe Handling, as well as the following diagram:
With regards to the suggested work-around (using <object>), we're aware that debugging this approach can be difficult. You can however debug the same document in another tab for the time being. Please note the other serious limitations of that work-around in both the answer and the subsequent comments.

Using html5 quirks mode in IE9

I've created a form that is dynamically created with JavaScript and is added in another website using the <script> tag.
The doctype used by this other website is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> which uses the quirks mode.
I've built my form by taking this in consideration and everything is working as expected in Chrome, Firefox and IE 10. However, when I test it in IE 9 and earlier, the form is not displayed at all. When I open the developper tools, I can see that IE 10 uses the new quirks mode but IE 9 and earlier uses the IE5 Quirks mode.
I was wondering if the new quirks mode can be used to display this page when using IE 9 and earlier. If this is not possible, I would like to force standard mode but only when using IE 9 or earlier and keep using quirks for every other browser.
I can't use the html5 doctype since their website is built with quirks mode instead of standards and their design is all broken when I use this doctype.
You cannot change the mode once the page is loaded. And you cannot change it programmatically. The only way to force a page into quirks mode is to load it without a valid doctype or with serious bugs in the HTML.
If you have a doctype, but your page is still loading in quirks mode, then it means that you have serious bugs in your HTML. This will give you bigger problems than just being in quirks mode. You should definitely fix those bugs. If you really want to be in quirks mode, drop the doctype, but you should really try not to have HTML code that is so bad it triggers quirks mode even with a doctype!
You can validate your HTML to find those bugs by using the W3C validator.
In terms of switching your page at runtime between IE10's two different quirks modes, the simple answer is that you can't do that.
Sorry about that.
However, to be honest, it's probably for the best. Using quirks mode is be a complete disaster anyway. It doesn't just change the layout mode; it also switches off most of the browser's features (ie pretty much everything invented since 1998).
But now for the good news:
Luckily, switching away from Quirks mode is a lot easier than you think.
The main layout issue (the different box model) can be fixed by adding the following to the top of your CSS:
*{box-sizing:border-box;}
This is the standards-compliant way to set the box model to the quirks-mode style layout. Most of the broken layout problems cause by switching from quirks mode to standards mode can be resolved with this simple CSS style.
There are other quirks, but they're relatively minor and shouldn't be too hard to deal with once you've fixed the main issue. A lot of them are actually not quirks mode issues, but bugs in older IE versions that the original coder may have had to hack his way around. There's no guarantee that these will continue working the same in future versions anyway, even if you do stick to quirks mode, so you would be best off fixing them now anyway.
So, to summarise:
Fix your page so it loads in standards mode. Valid doctype and valid HTML.
Use box-sizing to mitigate the main layout gremlins caused by the switch.
Fix the remaining layout issues manually.
It's really a lot less work than it sounds. Honest.

How to force Iframe to run quirks under a standard parent frame

We have a parent page that must run in IE9 standard mode, executing HTML5 commands.
Underneath we have an iframe that must run in compatibility mode (IE7/8).
In IE9, as I understand, iframes inherits their doctype from parent. is that correct?
Is there any solution for this issue? can , somehow, iframe be executed with quirks doctype under standard mode doctype parent frame?
thanks,
Tal
It's not possible to trigger a different rendering mode in a child iframe in IE9, as officially documented here: http://msdn.microsoft.com/en-us/library/gg558056(v=vs.85).aspx (emphasis added):
Although the newer rendering engine is only used when Windows Internet
Explorer detects that an HTML page has requested the highest level of
support for standards, the same is not always true for child pages
that might be loaded within frame and iframe elements. Because only
one rendering engine can be active at a time, IE9 Mode also includes
emulation for Quirks Mode.
However, as it says, you can trigger "quirks mode emulation" which leaves the IE9 rendering engine active but alters its behavior in several ways to match the old quirks mode.
JSBin demo: http://jsbin.com/ozejuk/1/
This example has a div with style background: #ff0000; background: 00ff00; border-radius: 30px ... in quirks mode, hex colors without # are accepted. In IE9 mode they are not. Loading the demo in IE9 will show a red div in the parent page, and a green div (but still with rounded corners) in the iframe.
How to trigger quirks mode emulation in an iframe: http://msdn.microsoft.com/en-us/library/gg558096(v=vs.85).aspx
Short version: omit DOCTYPE, add: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Complete list of effects quirks mode emulation has on rendering: http://msdn.microsoft.com/en-us/library/gg558047(v=vs.85).aspx

Tagcanvas with colorbox overlay is throwing IE9 into quirks mode?

I have implemented a tagcloud onto my webpage, instead of words I am using images and I am calling colorbox to provide a nice styled overlay and a biography of that person.
All of this works correctly in EVERY browser except IE.
I am using another colorbox overlay that does work on that same page, it is not in the tagcanvas area.
I noticed the IE9 Console throwing this at me:
HTML1113: Document mode restart from IE9 Standards to Quirks
Has anyone seen this before? Is there a way to stop it from switching to Quirks mode? I have tried a few different doctypes, even some meta tags like:
<meta http-equiv="X-UA-Compatible" value="IE=9">
Still, no dice! Ideas?
Your doctype is probably missing an FSI.
Doctype sniffing works by detecting which of these parts are present in the doctype declaration. If an FPI is present, but an FSI isn’t, browsers generally choose quirks mode, since this was the common way of writing doctype declarations in the old days. Browsers also choose quirks mode if the doctype declaration is missing altogether—which used to be very common—or is malformed.
See: http://reference.sitepoint.com/css/doctypesniffing

IE8 and quirks mode

Does IE8 run in quirks mode like IE6/7?
I have a webpage that has some truly bizarre code. The content is centered with padding and negative margins.
It works correctly in IE6/7 and other browsers but in IE8 the content area is half as wide and not centered (flag for quirks mode).
The source code has three blank lines before the DOCTYPE. I know that will throw IE6 into quirks mode. Will it also affect IE8?
I don't have access to the source so I cannot remove those lines to test it.
Changing the doctype to HTML 5 should fix some problems. I had an issue with min-width in IE8 using Strict doctype.
So changed this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
To this: <!DOCTYPE html>
See here: http://davidnaylor.org/blog/2008/09/ie8-and-max-width.html
Running a few quick tests that can be found here seem to indicate that blank lines shouldn't throw IE8 into Quirks Mode (which is different to Compatability Mode that everyone seems to be confusing it with).
I wrote a breakdown on how incredibly confusing the different modes of IE8/7 here and I didn't even include Quirks Mode in the breakdown. A detailed description of Quirks mode can be found here (not for the original question, but others might find it interesting.)
Today, I changed our DOCTYPE from XHTML v1.0 (Strict) to HTML5. I read somewhere that even though the IE's don't recognize the DOCTYPE yet, they will render the page in standards-compliant mode.
When I checked in IE8, the whole page looked whack (we have quite a bit of CSS and other styling). It took a while before I realized that there wasn't anything "wrong" with the CSS, or even IE8 for that matter. However, it WAS rendering in quirks mode.
Inadvertently, I found the answer in the question posted here, specifically this comment: "The source code has three blank lines before the DOCTYPE. I know that will throw IE6 into quirks mode. Will it also affect IE8?"
I don't know about blank lines, but when I made the change, I had used a javascript comment to "hang on to" my old DOCTYPE statement (which was ABOVE the new HTML5 DOCTYPE). Once I removed those lines (which may have included a blank line or two), my sweating stopped and IE8 rendered in standards-compliant mode.
Yes it does. Internet Explorer's quirks mode is IE5.5. IE6/7/8 switch back to 5.5 when quirks mode is present. So since it was working fine in IE6/7 it's not the quirks mode. There's a "Compatibility View" button in IE8 to address this issue. It's not a good solution to me though. You'll have to check your CSS code.
IE8 has a compatibility mode which should treat the page the way IE7 would. Have you tried viewing the page in compatibility mode?
Can you post a link to the page or some of the HTML itself? You could try adding the meta tag to force compatibility mode?
http://www.ditii.com/2008/08/28/ie8-standards-mode-and-ie7-compatibility-mode/
or for more info:
http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx