Codebitch : Click to return to MacEdition homepage
 

Fix for Netscape 4.x CSS bug crashes Netscape 4.0x in some contexts.

As documented in Eric A. Meyer’s Cascading Style Sheets: the Definitive Guide (O’Reilly), Netscape 4.x does not color DIV elements all the way to their putative borders when their background colors are defined using Cascading Style Sheets (CSS). To get their background colors to show, he recommends adding a very thin solid border (ie border: thin solid black; or whatever the color is) to the DIV’s style declaration in the stylesheet. Setting the border style to border:none will also have the same effect. However, this fix for the bug in all 4.x versions of Netscape activates another bug in 4.0x versions of Netscape, resulting in a crash if certain tags, mainly those new in HTML 4.0, are contained in the DIV. Version 4.08 is affected by this bug, but in a more limited number of cases than some of the earlier versions such as 4.04 and 4.05.

A DIV with the border style set will crash Netscape Navigator 4.04 or 4.05 if any of the following are included in it:

It doesn’t matter whether the style information for the DIV is set as a CLASS or as an ID, or inline in the tag definition itself. Crashes will still occur if any of these elements are included.

The ADDRESS element doesn’t crash the browser, but it breaks the CSS formatting for the rest of the DIV.

The following elements work fine inside the DIV.

Any of these elements outside the DIV should be fine. Note that the tags that tend to result in crashes are the tags introduced in HTML 4.0. These browsers were introduced before HTML 4.0 was finalised, and are therefore violating the requirement to simply ignore unsupported tags.

Netscape 4.08 will crash for ACRONYM, ABBR, DFN, Q, FIELDSET and CAPTION cases, but not for the nested table case.

All testing done under Mac OS 9.0.4, but has been confirmed for other versions. To conduct your own tests, save this HTML file to your local hard drive, and try suspect tags in your target version of Netscape.

Note to iCab users: this page contains some tags (U, STRIKE and FONT) that are deprecated in HTML 4.0 and cause iCab to grimace, but not frown.


CodeBitch
MacEdition.com
1 January 2001

Permission is granted to save this page to your local drive for testing purposes, provided any related findings not documented here are forwarded to the original author (CodeBitch).