Will there be any differences in a page thats rendered in IE7 compared to the same page rendered in IE7 standards mode in IE8 browser?

StackOverflow https://stackoverflow.com/questions/19771448

Вопрос

I've a page "Y" in an iframe in page "X" (parent).

Page X has http header : `X-UA-Compatible   IE=EmulateIE7`
and no meta tag 
and has doctype : `DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"`
Page Y has http header : `X-UA-Compatible   IE=EmulateIE7`
and has meta tag as `meta http-equiv="X-UA-Compatible" content="IE=8"`
and has doctype : `DOCTYPE html`

I see some behavioural differences in page Y when rendered in IE7 browser compared to the same page rendered in IE7 standards mode in IE8 browser (ie Browser mode: ie8, Document mode: IE7 standards mode).

I tried running this js javascript:window.alert('You are in ' + (document.compatMode==='CSS1Compat'?'Standards':'Quirks') + ' mode.') , it says "Standards mode".

But because the page is being rendered differently, I tend to think there is some quirky mode being introduced because of the headers inconsistencies.

I want to know if the behaviour differences is normal, if so why ?

PS: By behaviour difference, I mean, when I hover over a row in jquery grid, an image in one of the td disappears whereas in IE7 works fine.

Это было полезно?

Решение

Will there be any differences in a page thats rendered in IE7 compared to the same page rendered in IE7 standards mode in IE8 browser?

Direct answer: Yes, there will. There are known differences between the two, which is why it is considered a bad thing to do your IE-version testing using compatibility mode.

The issue is that "compatibility mode" is not actually using the IE7 rendering engine. It is using the IE8 rendering engine (or whichever IE version you're using), but with internal switches set to change the behaviour to mimic IE7. It's designed to look similar, but it is not the same engine, and it does not behave in the same way in all cases.

I was caught out badly with one of the bugs in IE8's IE7 mode a few years ago. It lost us several days worth of developer time trying to debug it until we worked out what was happening.

The only sane solution is to avoid compatibility mode at all costs. Set the X-UA-Compatible flag to IE=edge; force all versions of IE to use their best-available mode.

Compatibility mode is intended for sites that want to stick with their existing code; who want to upgrade their IE version but don't have time to fix their code. Unfortunately, the bugs in comaptiblity mode are such that it's actually easier just to fix the code to work with the upgraded IE version.

By the way, you mentioned "Quirks mode" thing question and in the tags. It is important to understand that what you're seeing is not Quirks mode. It may be quirky behaviour but it isn't actually Quirks mode. Quirks mode itself is a whole different thing (it's basically an IE5-compatibility mode, and you really don't want that). It is triggered by a missing or invalid DOCTYPE, but you're using valid doctypes so that's fine.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top