Tag: firefox

Today's Painful DOCTYPE Lessons

Just some painful web lessons I thought I'd share for similarly-beleaguered web developers who are wondering if their browsers (or their clients' browsers) are possessed of evil spirits.

Blank Page, No Errors in IE 8

A fraction of IE8 users reported a blank white page with no errors and a "done" loading message. It was completely unreproducible in any of my VMs, but through some searching, I found others suggesting the problem was tied to Compatibility View. When IE8 was released, my boss asked me to find a way to get rid of the IE8 Compatibility button, so I was using <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> in my templates to force ultra-super-futuristic behavior (under the theory that IE is *always* behind the times). However, one of the pages had no doctype (see prior Web Tricks for why that was necessary and not within my power to remedy). And apparently the combination of those two (future spiffiness and pathetic quirks mode past) freaks IE8 out... or about 1% of IE8, at least. And thus... the oh-so-helpful blank page. Anyway, removing the X-UA-Compatible meta tag fixed it. You could also set it to IE=7 or IE=EmulateIE7, but at that point I figured I'd leave the choice to the user on that page. If you already don't have X-UA-Compatible set, look for the Compatibility View button in the client browser and change it for the problem page. More reading on Compatibility View: FarukAt.eş: IE8 and the X-UA-Compatible situation and IEBlog: Just The Facts: Recap of Compatibility View.

Firefox Hover Missing In "Quirks" Mode

On the same page, we noticed that the hovers were not behaving as expected in Firefox. Turns out, when you are in Quirks Mode (the no-doctype mode), Firefox does not support CSS :hover on list elements. You didn't know Firefox even had Quirks Mode? Me too. I thought that kind of asinine behavior was reserved for IE, but apparently Firefox has jumped on that mess. Joy.

IE Does Font Sizing Right

I know I put down IE a lot on my site. As a web developer, it has made my life a living hell for the last 4 years. Some people prefer to point the finger at Firefox for starting all these compatibility issues, but for the most part it is IE that deviates from CSS specifications (and sometimes ECMAScript specs too!).

However there is one issue where Firefox is wrong. Dead wrong. So painfully wrong that I have been complaining about it for years. See, Firefox ignores CSS spec on pixel font sizes. Its reasoning is that people have misused pixel font sizes all over the web and wouldn't it be nice if old granny's could read those pages anyway? But this kind of thinking is what put IE in the mess that it's in now. You can't just ignore spec because people made their pages wrong. They are WRONG.

The reason why pixel fonts are and should be absolute is because there are times when you really need text to be absolute. When it's aligning with an image, or needs to fit inside a box. Scaling it so the user can read it may make them happier, but it makes my page look really ugly and can break a lot of other elements depending on that one to stay in its own damn area. When we say we want a box to be 300 pixels wide, you don't go scaling that, now do you, Firefox? If we wanted it scaled, we would have used "em" or percent. Don't make us use a text graphic just to force the size!

And apparently this will now be causing grief to more developers thanks to the new all-in-one advertising tool from google's adsense: http://groups.google.com/group/adsense-help-optimization/browse_thread/thread/d905b7a9b02dcf23/87844a19ac8320b1

You might say that google could make their banners scalable to overcome this, but banners have traditionally been of a fixed size and few websites can accommodate scaling sizes. The fact is, we as designers should be able to say that we want our text in some circumstances to be *just the right size*. And I am pissed off that Firefox won't let me do it. And Safari. Opera, thank god you decided to just add Zoom and skip the whole font-sizing thing. You are awesome. :)

Annoying Float Bug in Firefox

So I just ran into a really annoying float bug in Firefox (ironically discovered when trying to fix the header navigation of the Drupal SpreadFirefox theme). When you do a double-float right, or a float right inside an absolutely positioned div, the top-most container becomes a screen-filling monstrosity.

See the following:

FLOATED:
test 1
test 2
 
ABSOLUTE:
test 1
test 2
 
<style type="text/css">
#floated {position:relative;float:right;
color:black;background:#999;border:1px solid black;opacity:0.5}
#floated div {position:relative;float:right;
border:1px solid black;padding:2px;margin:.5em;}
</style>
<div id="floated">
<div>test 1</div>
<div>test 2</div>
</div>

In Safari, test 1 and test 2 float right, with the containing div surrounding them in a nice discrete little box. In Firefox, the containing div fills the whole width of the page.

Note that when test 1 and test 2 float left, it works as expected in Firefox - regardless of the containing div's float or absolute positioning:

FLOATED RIGHT/LEFT:
test 1
test 2
 

But unfortunately this would reverse the tabs in Drupal SpreadFirefox without other code-level alterations.

AJAX + Close Window Firefox failure

It appears that in Firefox one must do somersaults to use javascript-opened windows and AJAX. There is a conflict between window.close() and AJAX and a delayed window.close() is prevented by a second Firefox bug where the window reference becomes corrupted in some way. The final solution appears to be to delay the AJAX call instead, using setTimeout().

Complete Test File

Switch to our mobile site