Saturday, October 5, 2013

Converting Quirks Mode to Standards Mode

I've spent the past month dealing with Quirks Mode. That's the legacy mode of Internet Explorer. Wikipedia defines Quirks Mode:

Quirks Mode

The problem I ran into was I was chasing the wrong Quirks Mode bug. Here's a nice compendium of Quirks Mode bugs:

Quirks Mode Living Standard

I like the fact they call Quirks Mode a living standard now. Finding all the ongoing quirks of old browsers, and the web pages that depend on these quicks, is an ongoing effort. Therefore, calling it a living standard makes sense.

Had I found the above Quicks Mode Living Standard earlier, I might have saved myself some trouble. I was under the false impression that the background color disappearing on my <div> tag was due to it collapsing to zero height because of its floating content.

I further had the illusion that Quirks Mode would give that same <div> something other than a zero height and therefore it was Quirks Mode that was making the background color appear like it is supposed to under Internet Explorer when Quirks Mode was turned on.

Wrong. Wrong. Wrong.

Quite simply, I thought quirks mode gave a height to a <div> that had 100 percent floating content. Not true.

The reason I thought that old versions of Internet Explorer would not collapse a <div> to zero height was because I thought I was seeing it right before my eyes. I was wrong. Faulty observation.

Complicating the situation was the fact that I indeed was observing Quirks Mode. It just was not the Quirks Mode I thought it was. It turned out to be the hashless hex color quirk documented on the above living quirks page and had nothing to do with collpasing <div> height.

As a consequence, I spent hours researching all the different ways to float divs inside of divs and not have the containing div be zero height. I learned 5 different techniques for containing floating divs without collapsing the containing div.

Five techniques later I find out it was a hex color that was not hashtagged but was instead just a six-digit barebones hex number. That's all it was. That's why the background color never showed up in Standards Mode. It was never there!

Oh, well. Faulty observation. I feel like the TV repairman who failed to observe the TV was not plugged in and staring checking more complicated things first.

The lesson? Look at the simple things first.

Ed Abbott

No comments:

Post a Comment