alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.18k stars 321 forks source link

Should we force IE compatibility mode off? #1034

Closed NickColley closed 5 years ago

NickColley commented 6 years ago

When testing some IE8 issues I accidentally turned on IE7 standards mode, I think when the page errors it'll prompt you to turn it on.

I'm wondering if we should include meta tags, that you often see people using?

https://msdn.microsoft.com/en-gb/en-en/library/cc817574.aspx

<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
NickColley commented 6 years ago
screen shot 2018-10-16 at 14 10 57
36degrees commented 5 years ago

Yep. I think that given IE8 is the lowest version of IE we support, it makes sense to do this đź‘Ť

paulwaitehomeoffice commented 5 years ago

I’m not sure the meta tag will entirely “force” compatibility mode off. I wrote up the compatibility mode settings in IE 8 some time ago on Stack Overflow; I don’t think they’re affected by the meta tag.

The Service Manual also no longer requires testing on IE 8, so I do wonder if it's worth adding the tag at this point. (I believe IE 9 got rid of compatibility mode?)

NickColley commented 5 years ago

https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do

If I don't have "X-UA-Compatible" in headers, what would happen? – Morgan Cheng

Basically what happens is when you have the X-UA-Compatible it tells IE how to behave in regards to the value you set (IE=edge etc) if it is not there IE will show the site how it thinks best it should be shown. That could be compatibility mode or that could be the latest version of IE. Whatever Microsoft/IE thinks is best. Make sense?

This seems to confirm that having the tag would help any users using older IE...

NickColley commented 5 years ago

@paulwaitehomeoffice GOV.UK Frontend still supports IE8 as there are some services that still support IE8 for example in prisons (https://github.com/alphagov/govuk-frontend/issues/1026)

paulwaitehomeoffice commented 5 years ago

An old Microsoft blog post suggests that the meta tag does at least get rid of the compatibility mode button, so that sounds good.

colinrotherham commented 5 years ago

Yes, definitely add this.

For older Internet Explorer you'll either want the HTTP header or the tag. Otherwise people will accidentally click that compatibility view button like you.

The meta tag has higher priority, and can be compressed (gzip) unlike the header.

It's possible for intranet zone settings, custom enterprise lists (via directory group policies) or the official Microsoft Windows Update list to override it but it's a good default.

36degrees commented 5 years ago

For context, this was not present in GOV.UK Template – nor are there any mentions of it in GOV.UK Template's Git history (according to git log -S "X-UA-Compatible"). (Not to say it shouldn't be added)

It does appear to be in many GOV.UK apps.

36degrees commented 5 years ago

Resolved as part of #1116