Residual Style |
This page is the topmost page for testing residual style. Residual style handling refers to automatic document conversions performed by Gecko when encounters mal-formed HTML fontstyle elements (explicit style tags -- not CSS). For example:
<html><body><b><div>text</div></b></body></html>
|
|
div text here | div text here |
According to the spec, <b> is a fontstyle element, whereas <div> is a block element. As a rule, fontstyle tags can't contain block elements, which means that the preceeding example is malformed. In order to remain backward compatible and simultaneously maintain well-formed documents, Gecko may have to rewrite the document to be correct. The prior example is rewritten by Gecko like this:
<html><body><div><b>text</b></div></body></html>
How To Create Your Own Tests |
You can make your own residual style tests either manually, or by using the htmlgen program that is checked into the tree at mozilla\htmlparser\htmlgen. Most residual style problems fall into one of two categories: 1) illegal containment; 2) malformed closures. Note that these problems can exist for fontstyle, phrasal and special tags (see the list below). Also note that navigator behavior is very inconsistent with respect to these problems, so don't assume that one testcase covers all cases.
Illegal Containment Sample
This example shows a <b> containing
a <div>, which is illegal under HTML.
<html><body><b><div>text</div></b></body></html>
Malformed Containment Sample
This example shows misplaced close
tags, which often wreak havoc with style in navigator.
<html><body><b><div>text1</i>text2</div></body></html>
List of FontStyle Tags: | <b>, <big>, <i>, <s>, <small>, <strike>, <tt>, <u> |
List of Phrase Tags: | <abbr>, <acronym>, <cite>, <code>, <dfn>, <em>, <kbd>, <samp>, <strong>, <var> |
List of Special Tags: | <a>, <applet>, <basefont>, <bdo>, <br>, <font>, <iframe>, <img>, <obect>, <map>, <q>, <script>, <span>, <sub>, <sup> |
Residual Style Testcases |
The following testcases were taken from real bugs. In most cases, these have been reduced to a minimum sample, and they have been linked together so that you compare them in sequence against other browsers.
Click on any of the following links
to begin...
Residual style: | This term describes the case where malformed fontstyle elements that get closed out by block elements need to be reopened later in the document. The term can about for two reasons: 1) because style gets reopened "residually" -- later in the document; 2) because explicit style tags tend to leave an unpleasant "residue" on html documents. |