views:

74

answers:

3

What are browser bugs that are obscure in the sense that they are hard to find or only occur under certain conditions, but can seriously bite you? Please also provide fixes or workarounds where available.

Things like the IE6 float margin or PNG bugs are well known by now, please concentrate on rarer problems.

This is a community wiki, so please feel free to edit answers to make them more specific or accurate or to add solutions. One problem and solution at a time please.

A: 

When serving documents as XHTML, Internet Explorer 7 and 8 may display a blank page.

This can happen if IE tries to display the page using the wrong encoding. That even means the page may display correctly in IE on one computer, but fails on another if the default encoding settings differ. Just specifying the encoding using meta tags in the document itself is not enough in this case, since IE may (wrongly) guess the encoding before reading the tags.

Solution:
Make sure to use the appropriate HTTP Content-Type header, like:

Content-Type: text/html; charset=UTF-8
deceze
If you serve an xhtml document with *anything* other than the xhtml mimetype all browsers that support xhtml will consider it to be a broken html document. xhtml is not compatible with html.
olliej
I read elsewhere that serving it using application/xhtml MIME type may produce problems on older browsers. Feel free to edit the entry to clarify the source of the problem.
deceze
xhtml is cause for wide confusion. The facts as I understand them: IE (all versions) does *not* support xhtml in any form or version. Safari, Firefox, and Opera on the other hand do. The presence of a doctype will trigger "standards" mode in a browser, (as opposed to quirks mode), but will not trigger xhtml parsing mode- only the mime type can do that. If you set the correct mime type for an xhtml document though, it will not open in IE. the xhtml 1.0 w3c standard is lenient- it allows you to serve as text/html provided you follow some rules for backward compatibility with html.
Breton
However if you serve xhtml as text/html, again it gets parsed as badly written html by all browsers. The w3c xhtml 1.1 standard does not permit you to serve it as text/html.
Breton
Apache, and most browsers will interpret files with the .xhtml extension as xhtml proper. I reccomend everyone try this out with some of their pages to see what real xhtml looks like when loaded into a browser. (Chances are you'll get a big yellow error message due to a parse error)
Breton
+3  A: 

An embedded swf will not load in firefox if placed in a div of 0 width or height. It WILL load in other browsers, but you may set the width or height to 1px to force loading across all browsers.

Stefan Kendall
A: 

One that I came across recently: IIRC it affects IE and Firefox but not Chrome. Haven't tested it elsewhere.

If you have a cell (<td>) that is supposed to have a border, the border won't show up if the cell is empty. Put a "&nbsp;" in the cell and it's fixed.

MatrixFrog