How to specify QuirksMode for doctype in iframe in IE 9?
Asked Answered
D

2

8

Question:

We have a portal, where the doctype is compatible to xhtml 1.0. Then, in the portal, we have a content iframe, where we embed different web-applications. Some of those application were written by us, some are 3rd party.

Now in that iframe, we embed, amongst other things, Microsoft Reporting Service reports. The problem is, Reporting Service Reports requires QuirksMode to render "correctly". And the portal doesn't work in QuirksMode (which is fine, as far as I am concerned, since we only target 9, and possibly IE8). The portal also doesn't render fine in IE7, and we're going to abandon IE8 support as soon as possible.

However, IE9 seems to inherit the document mode from the parent page, so the reporting service reports gets rendered in IE9 standards mode instead of quirks mode. So all the reports are displayed incorrectly (and i don't mean a little bit, it's really severe, completely incorrect, absolutely horrible)

The problem is, we can't change reporting service...
There's no way to make reporting service (any version) render non-quirksmode HTML.

As per Will an iframe render in quirks mode? i could add

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="X-UA-Compatible" content="IE=8" />

To get the iframe to render in QuirksMode. (edit: doesn't even work when I don't care about how the portal renders and put it in anyway)

Unfortunately, the portal is as said, not IE7 compatible, so this is not an option.
Also, the SSRS reports runs on another domain than the portal, so I can't use JavaScript/jQuery in any way.

Is there any way to make an iframe render in QuirksMode, without destroying the parent page layout ?
Or a (already existing) way to make reporting service render valid HTML (I certainly don't have the time to write a custom HTML rendering extension) ?

Douce answered 5/9, 2012 at 9:0 Comment(11)
It's a somewhat dirty idea, but maybe you can add some invalid HTML to the iframe, forcing the IE fall back to quirks mode. Yet I do not know if that would lead to the whole page being rendered in quirks mode.Yawning
Great idea, combining iframe and its evil brother quicksmode.Threat
@Rufus: It's spelled quirksmode, not quicksmode, but you have a point there :) In my defense: the idea wasn't mine (actually I was never asked nor told, neither about the iframe, nor about using SSRS) ! However, since I am "ReportGuy", it seems the blame is mine, which seems to mean that I am APPARENTLY "guilty"...Douce
@_puras: Yes, my first idea, too. But the question is how ? I can't control the reportserver (will be customer's), I can't change SSRS (Microsoft's closed-source sourcecode) and I can't use JavaScript to insert invalid HTML because the different-domain security prohibits that, and I can't write my own rendering extension, because I don't have the time (and would need to register the module at customer X for reporting service version y and .net framework version z).Douce
@Rufus: Oh by the way: For 3rd party content, the only viable other options than iframe would be popups (evil big brother of iframe)...Douce
You could write a proxy servlet which retrieves the report HTML (e.g. using Apache HttpClient) and returns it decorated with some HTML garbage. I admit it's really getting evil here ;-)Yawning
Would a double iframe do it? (an iFrame in an iFrame) the middle iframe being under your control and having a missing doctype, the lowest child then inheriting quirksmode from the middle one? Probably the most evil of them all!Whirlpool
@Matt.C: This assumes that the middle one doesn't inherit it's doctype from its parent. I just tried, and it does inherit... So that doesn't help.Douce
Aaaaargh, even setting the meta tags in the portal doesn't help as well. One really needs to change the doctype of the parent page. There's ABSOLUTELY NO other solution.Douce
I died a little, upon reading all this HTML blasphemyUndercroft
Filed bug: connect.microsoft.com/SQLServer/feedback/details/762046/…Douce
M
2

Via MSDN:

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.

Sorry, but what you want to do is impossible to achieve in IE9.

Minette answered 1/2, 2013 at 17:31 Comment(0)
D
0

Necromancing as per 2016.

If you have the same problem (with SSRS):
SQL-Server 2016 CTP 3.3 Reporting-Service (preview portal) delivers standards-compliant HTML.

Douce answered 14/3, 2016 at 14:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.