You’re viewing an archive of outdated material. Visit The Web Standards Project’s updated site to learn about our current mission.

Error Handling Bugs (1)

MacIE's parser is over lenient, a misfeature that leads stylesheet authors who rely on MacIE to highlight mistakes into a false sense of security.

Not ignoring the lack of units

For example, MacIE incorrectly assumes that if the units are omitted from a property value then "pixels" was meant. This document contains the following stylesheet:

    DIV.nounits { border: 4px green solid; }
    DIV.nounits { border: 4   red   solid; } /* Invalid */

Because of CSS1's error handling rules, the second declaration above should be ignored, thus only leaving the first rule's declaration, giving the following DIV a green border.

This block should have a green border.

Not ignoring invalid units

MacIE also incorrectly interprets unknown units as pixels. This is dangerous as with future releases of CSS, new units may be introduced, and the legacy of misinterpreting lengths will cause documents using the new format to look uglier than expected. This will reflect badly on authors, while in fact it is Microsoft that is at fault.

This document contains the following stylesheet:

    DIV.badunits { border: 4px green solid; }
    DIV.badunits { border: 4nm red   solid; } /* Invalid */

Because nm are not valid units, the second declaration above should be ignored, thus only leaving the first rule's declaration, giving the following DIV a green border.

This block should have a green border.

Not ignoring quoted property values

When coming across a quoted property value, conforming CSS1 browsers should ignore the entire property declaration if they do not expect quotes. This is to allow for future extensions of the specification. To demonstrate the problem, this document contains the following stylesheet:

    DIV.quoted    { color: green; }
    DIV.quoted    { color: "red"; }

Because "red" is quoted, and in CSS2 color does not take quoted values, the second declaration above should be ignored, thus only leaving the first rule's declaration, giving the following DIV green text:

This text should be green.