Tired Of Being Alternative Photography, art, design, technology. And everything in-between.

IE10 and framesets

Posted by
Edoardo Galvagno
25 May 2013
in tech, web, ie, javascript
IE10 ha alcuni problemi con i frames html.

Say you have a legacy web application that still relies on frames and framesets (and yes! I know you shouldn’t, don’t get me started on that, please).

With IE10 you could get a blank white page instead of content or you don’t get an updated display while you should. Either case, resizing IE’s window makes the content reappearing or refreshing just fine.

Blank white pages

IE10 renders all the pages of a frameset in the same document mode. This means that if you have a frame that is rendered in compatibility mode, all the frames will be rendered in the same way (even if I couldn’t reproduce that with just some content in quirks mode).

Of course, by now you should have all the pages with <!DOCTYPE html> and have deleted all of you css hacks and X-UA-COMPATIBLE headers; but it wouldn’t be a legacy application anymore!

Window not updated

Even better, if you resize the columns or rows in a frameset programmatically in Javascript, IE10 doesn’t refresh the page at all.

This is a known bug and one that Microsoft is not going to squash.

Good news here is that the fix is simple: force the redraw of the entire window by briefly changing some css property.

In my case I chose to change the background color to white of the frameset I was resizing, just to empty the value again 1 millisecond later.

window.frameset_to_change = frameset;
frameset.style.backgroundColor = "#fff";
setTimeout("window.frameset_to_change.style.backgroundColor = '';", 1);

And no, I had to use an actual color (#fff) and not transparent as IE10 was too smart to be cheated.