Does a Standards web page inside of an IFrame in a Quirks web page render in Standards or Quirks?

Working with a customer, I was explaining the 3 rendering engines that we have in Internet Explorer 8 (Quirks, IE7 Standards, and IE8 Standards), and how you opt into them. As we went through this, a question came up where I didn’t know the answer: what happens if you have a page whose DOCTYPE specifies Quirks mode, but which hosts an IFrame containing a page whose DOCTYPE specifies standards mode? My search engine mojo may have been inadequate that day, but I couldn’t locate an authoritative answer.

Rather than guess, I figured I would build a test. I wrote the following page, and called it guest.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
        <script type="text/JavaScript" language="JavaScript">
            function bodyOnLoad() {
                if (document.getElementById("casesensitive") != null) {
                } else {
    <body onload="bodyOnLoad()">
        <p>This is the guest</p>
        <div id="caseSensitive"></div>

What I had done was to leverage a change in case sensitivity in JavaScript, which would cause a match when in IE8 standards, or a failure to match in IE7 standards or Quirks. If you launch this page by itself, then it will pick up standards (as long as you’re not on the Local Intranet with the default group policies) and show IE8+. (You can manually set it to Quirks or IE7 using the dev tools to see it change modes.)

Now, let’s host this HTML in an IFrame inside of a page which specifies Quirks Mode:

        <title>Mixed rendering test</title>
        <p>I am the host</p>
        <iframe src="guest.html"></iframe>

When we run it – what do we find?


So, a standards page inside of an IFrame on a Quirks page still runs in standards. Seeing is believing.

Comments (1)

  1. Richard says:

    That's pretty much what you would expect – if the page specifies standards mode, it should always be rendered in standards mode.

    The more interesting issue is what happens when script in the parent quirks-mode page accesses the DOM of the standards-mode page. I seem to recall there was a post on the IEBlog a couple of years ago which discussed this.

Skip to main content