Conditional comments do not work when emulating document modes via F12 Developer Tools - by Jacob Rossi [MSFT]

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


ID 806767 Comments
Status Closed Workarounds
Type Bug Repros 46
Opened 10/28/2013 9:26:06 AM
Access Restriction Public

Description

Conditional comments, such as:

  <!--[if IE 8]>
<p>You should only see this in IE8 mode.</p>
  <![endif]-->

are only supported in legacy document modes of Internet Explorer (see http://msdn.microsoft.com/library/ms537512.aspx). In IE11 GA, legacy mode conditional comments are not enabled when choosing a document mode through F12 Developer Tools. Choosing a document mode through X-UA-Compatible, however, does enable conditional comments for the legacy mode.
Sign in to post a comment.
Posted by krappies on 6/11/2014 at 3:48 AM
+1 (Team)
Posted by Jacob Rossi [MSFT] on 4/22/2014 at 9:22 AM
This should be fixed in Update 1 for IE11, released last week. Thanks for the great feedback.

http://blogs.msdn.com/b/ie/archive/2014/04/02/announcing-an-updated-version-of-internet-explorer-11-available-on-windows-8-1-windows-7-and-windows-phone-8-1.aspx
Posted by Janry_wang on 4/22/2014 at 4:42 AM
please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!please!!!!!!!!!!!!!!!!!
Posted by Ansar_1 on 4/1/2014 at 6:01 AM
This is still an issue.... wounder when they will implement a fix.
Posted by bppress on 3/19/2014 at 7:25 AM
+1
Posted by Ajay Chirundoth on 3/10/2014 at 1:01 AM
Posted by joe t. _ on 12/2/2013 at 12:12 PM

<!--[if IE lte 9]>
<p>Visible to IE</p>
<[endif]-->

Did some good, In IE 7 mode i could see the bootstrap grids!!...but no glyphicons, no watable, no evenntCalendar and no charts.js. Then the IE just hangs and closes down :-(
Posted by Gareth Talty on 2/25/2014 at 1:50 PM
This is what happens:

Be a web developer.
Buy Windows 8 for your testing machine.
Realise that the last 10 years of hacking together web apps to work with IE can no longer be tested with IE11.
Sit and watch open bug for 6 months.
Dispair.
Posted by morgul88 on 2/12/2014 at 4:10 PM
Happy to see that this will be fixed! +1
Posted by Adrien BE on 1/24/2014 at 2:23 AM
Thanks for the update Jacob. And thanks a million in advance for fixing this. Too many of us (devs) have to make our website work with IE & this feature is extremely needed.
Posted by Jacob Rossi [MSFT] on 1/22/2014 at 10:36 AM
Thanks, everyone, for the great feedback. We're looking into a fix for this issue.
Posted by BOA Ideas on 1/22/2014 at 1:35 AM
The whole point of having an emulator is to emulate. IE11 with IE8 mode on developers tools should act as IE8. Otherwise what's the point?
Posted by Draxzion on 1/16/2014 at 6:39 PM
A lot of good stuff in IE11, but this hurts it.
Posted by codeMonkey3 on 1/14/2014 at 11:07 AM
Please fix this. I was actually quite impressed with IE 11 and this is really disappointing.
Posted by A. Mule on 1/13/2014 at 3:19 PM
+1000000000000000

devs really really NEED this
Posted by Thomas Higginbotham on 1/12/2014 at 2:53 PM
Conditional comments are essential for things like the HTML5 shim and IE-specific CSS issues. Feature detection does not cover every use case, and even if it did, it wouldn't be useful when working with outdated legacy code. The vast majority of the time, changing the document mode allowed for quick and easy debugging, and although it isn't perfect, it is a huge time saver. Please re-implement.
Posted by kangax on 1/10/2014 at 9:17 PM
+1
Posted by Mark Root-Wiley on 1/10/2014 at 2:08 PM
+1
Posted by LMTim on 1/10/2014 at 1:39 AM
Please sort this out Microsoft, there was no need for this to be removed and you have now added hours worth of overhead to our testing process. We can't be expected to load VMs every time we need to test something, it's not practical or sensible.
Posted by Kyle Merritt on 1/6/2014 at 8:04 AM
This is a big problem. I can't go back to IE10 on my new computer (because it came with IE11.) Now I can't test my work on this computer.
Posted by Lariza on 1/6/2014 at 7:26 AM
+1
Posted by tgiphil1 on 1/2/2014 at 3:50 PM
+1
Posted by thany1 on 12/31/2013 at 1:50 AM
Correction,
@Microsoft, please respond

(where's the edit button?)
Posted by thany1 on 12/31/2013 at 1:50 AM
<!--[if lte IE 11]>

That seems to execute the conditional comment, regardless of the document mode.
Clearly a bug that needs fixing.

@Micorosft, please respond.
Posted by Internet Explorer User on 12/20/2013 at 3:20 PM
Internet Explorer team, please respond to this bug!
Posted by ravenseyedesign on 12/7/2013 at 11:19 AM
I use VMs for complete testing before going to production, but I've always enjoyed the convenience of doing quick preliminary testing via the old IE emulation available in more recent versions of IE. I've found the emulators to be reliable enough for rough testing, and it's far more efficient to click through browser modes in a single browser to get a quick look than to launch each VM and go through the full testing process every time. The emulation is certainly not a viable substitute for real testing in each targeted browser, but it's an additional tool in my web development workflow that I really miss now that it's broken.

The lack of solid support for conditional comments in the emulation tools in the current version of IE 11 renders these emulation tools useless to me, since I still use conditional comments to target very old versions of IE, and feature detection is not always the best tool for working around specific bugs.

MS, please either fix CC support in the emulator, or just remove the emulator completely. I would really like to see the emulator fixed rather than removed, but keeping around it when it's this badly broken is a source of frustration.
Posted by joe t. _ on 12/2/2013 at 12:12 PM
i can also reproduce this problem. Especially noticed when i tried a Javascript-based CC test similar to this: https://gist.github.com/padolsey/527683

Another strange behavior i noticed, which i don't think existed previously:

<!--[if lte IE 9]>
<p>Visible to IE9 and below</p>
<[endif]-->

Does not work, as reported.

<!--[if IE lte 9]>
<p>Visible to IE</p>
<[endif]-->

DOES "work", but to all versions of IE, as if testing [if IE]. My impression in previous versions of conditional comments, if the syntax was wrong, the entire conditional comment failed, so the interior was treated as part of the comment. In the above sample, the syntax is wrong, but IE manages to parse the [ie IE] part while the rest of the condition is ignored.

Very frustrating. Guess i'll spend the next few days downloading VM files & trying to get them to work.
Posted by Pontiaction on 11/26/2013 at 3:37 PM
Discovered this today on Windows 8.1 running IE11. Comments such as "if IE 7" and "if lte IE 8" are no longer being acted upon while in the appropriate document mode. This is a significant hole in the usefulness of the document mode setting itself, and spinning up a separate installation of Windows in a VM for every major version of IE that I need to support (which still sometimes goes all the way to IE 7) seems like a ridiculous amount of overhead.
Posted by thoughtpalette on 11/20/2013 at 8:30 AM
Having the same issue. Makes testing legacy browsers in the new developer tools pointless for current code bases as many assets are loaded conditionally.
Posted by nicholasbg on 11/12/2013 at 9:01 AM
MS is for some reason removing conditional comment usage even when emulating old browsers. This is crazy. I think it has something to do with their push to use feature detection.

While feature detection is, in a perfect world, the right way to go when it comes to implementing different features/style sheets/javascript etc. In the real world, we have to detect old versions of IE via conditional comments due to bugs. Z-Index and percentage padding not working as expected in IE7? @font-face not using the correct font-weight in IE8? These bugs are not really detectable as a feature and are best addressed with conditional comments.
Posted by spizder on 11/7/2013 at 12:21 PM
Microsoft, please reassure me you did not introduce this bug on purpose to prove your point that old IE testing should be only done in VMs. Document mode is an extremely helpful tool for the quick and dirty round of testing.

There was a bug opened back in July to bring back browser modes in IE11. Is it how you respond to it, by making document mode unusable?
http://connect.microsoft.com/IE/feedback/details/795132/bring-back-browser-mode-in-ie11
Posted by Adam Plocher on 11/7/2013 at 12:31 AM
The only conditional comment that seems to work is [if IE], but doing a check against a specific version of IE doesn't seem to work at all.