pjs/parser/htmlparser/tests/html/residual.html

277 строки
12 KiB
HTML

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Rick Gessner">
<meta name="GENERATOR" content="Mozilla/4.6 [en] (WinNT; U) [Netscape]">
<title>ResidualStyle</title>
</head>
<body>
&nbsp;
<table COLS=1 WIDTH="30%" BGCOLOR="#FFFFCC" >
<tr>
<td><b><font face="Verdana"><font size=-1>Residual Style&nbsp;</font></font></b></td>
</tr>
</table>
<p><font face="Verdana"><font size=-1>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:</font></font>
<p><font face="Verdana"><font size=-1>&lt;html>&lt;body><font color="#009900">&lt;b></font><font color="#3366FF">&lt;div>text&lt;/div></font><font color="#009900">&lt;/b></font>&lt;/body>&lt;/html></font></font>
<br>&nbsp;
<br>&nbsp;
<table BORDER COLS=2 WIDTH="50%" >
<tr BGCOLOR="#FFFFCC">
<td>
<center><b><font face="Verdana"><font size=-1>Expected Result</font></font></b></center>
</td>
<td>
<center><b><font face="Verdana"><font size=-1>Result defined by HTML4.0</font></font></b></center>
</td>
</tr>
<tr>
<td><b>div text here</b></td>
<td>div text here</td>
</tr>
</table>
<p><font face="Verdana"><font size=-1>According to the spec, &lt;b> is
a fontstyle element, whereas &lt;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:</font></font>
<p><font face="Verdana"><font size=-1>&lt;html>&lt;body><font color="#3366FF">&lt;div></font><font color="#009900">&lt;b></font><font color="#3366FF">text</font><font color="#009900">&lt;/b></font><font color="#3366FF">&lt;/div></font>&lt;/body>&lt;/html></font></font>
<br>&nbsp;
<br>&nbsp;
<table COLS=1 WIDTH="30%" BGCOLOR="#FFFFCC" >
<tr>
<td><b><font face="Verdana"><font size=-1>How To Create Your Own Tests</font></font></b></td>
</tr>
</table>
<p><font face="Verdana"><font size=-1>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.</font></font><font face="Verdana"><font size=-1></font></font>
<p><b><font face="Verdana"><font size=-1>Illegal Containment Sample</font></font></b>
<br><font face="Verdana"><font size=-1>This example shows a &lt;b> containing
a &lt;div>, which is illegal under HTML.</font></font><font face="Verdana"><font size=-1></font></font>
<p><font face="Verdana"><font size=-1>&lt;html>&lt;body><font color="#009900">&lt;b></font><font color="#3366FF">&lt;div>text&lt;/div></font><font color="#009900">&lt;/b></font>&lt;/body>&lt;/html></font></font><font face="Verdana"><font size=-1></font></font>
<p><b><font face="Verdana"><font size=-1>Malformed Containment Sample</font></font></b>
<br><font face="Verdana"><font size=-1>This example shows misplaced close
tags, which often wreak havoc with style in navigator.</font></font><font face="Verdana"><font size=-1></font></font>
<p><font face="Verdana"><font size=-1>&lt;html>&lt;body><font color="#009900">&lt;b></font><font color="#3366FF">&lt;div>text1&lt;/i>text2&lt;/div></font>&lt;/body>&lt;/html></font></font>
<br><b><font face="Verdana"><font size=-1></font></font></b>&nbsp;
<br><b><font face="Verdana"><font size=-1></font></font></b>&nbsp;
<table WIDTH="100%" >
<tr>
<td><b><font face="Verdana"><font size=-1>List of FontStyle Tags:&nbsp;</font></font></b></td>
<td><font face="Verdana"><font size=-1>&lt;b>, &lt;big>, &lt;i>, &lt;s>,
&lt;small>, &lt;strike>, &lt;tt>, &lt;u></font></font></td>
</tr>
<tr>
<td><b><font face="Verdana"><font size=-1>List of Phrase Tags:</font></font></b></td>
<td><font face="Verdana"><font size=-1>&lt;abbr>, &lt;acronym>, &lt;cite>,
&lt;code>, &lt;dfn>, &lt;em>, &lt;kbd>, &lt;samp>, &lt;strong>, &lt;var></font></font></td>
</tr>
<tr>
<td><b><font face="Verdana"><font size=-1>List of Special Tags:</font></font></b></td>
<td><font face="Verdana"><font size=-1>&lt;a>, &lt;applet>, &lt;basefont>,
&lt;bdo>, &lt;br>, &lt;font>, &lt;iframe>, &lt;img>, &lt;obect>, &lt;map>,
&lt;q>, &lt;script>, &lt;span>, &lt;sub>, &lt;sup></font></font></td>
</tr>
</table>
<font face="Verdana"><font size=-1></font></font>
<br><font face="Verdana"><font size=-1></font></font>&nbsp;
<br><font face="Verdana"><font size=-1></font></font>&nbsp;
<table COLS=1 WIDTH="30%" BGCOLOR="#FFFFCC" >
<tr>
<td><b><font face="Verdana"><font size=-1>Residual Style Testcases</font></font></b></td>
</tr>
</table>
<p><font face="Verdana"><font size=-1>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.</font></font>
<p><font face="Verdana"><font size=-1>Click on any of the following links
to begin...</font></font>
<br>&nbsp;
<table BORDER COLS=7 WIDTH="90%" >
<tr>
<td><font face="Verdana"><font size=-1><a href="bug466.html">Bug466</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug991.html">Bug991</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug1239.html">Bug1239</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug1259.html">Bug1259</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug2419.html">Bug2419</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug2447.html">Bug2447</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug3073.html">Bug3073</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug4814.html">Bug4814</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug4809.html">Bug4809</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug4956.html">Bug4958</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug5859.html">Bug5859</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug6233.html">Bug6233</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug6925.html">Bug6925</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug7447.html">Bug7447</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug7723.html">Bug7723</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug7724.html">Bug7724</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug7823.html">Bug7823</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug7889.html">Bug7889</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8080.html">Bug8080</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8056.html">Bug8056</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8681.html">Bug8681</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug8738.html">Bug8738</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8771.html">Bug8771</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8913.html">Bug8913</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug8996.html">Bug8996</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug9563.html">Bug9563</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug10049.html">Bug10049</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug10324.html">Bug10324</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug11381.html">Bug11381</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug12118.html">Bug12118</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug12632.html">Bug12632</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug12468.html">Bug12468</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug13107.html">Bug13107</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug14276.html">Bug14276</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug14636.html">Bug14636</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug14981.html">Bug14981</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug18159.html">Bug18159</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug18185.html">Bug18185</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug18403.html">Bug18403</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug18865.html">Bug18865</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug19172.html">Bug19172</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug19194.html">Bug19194</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug20030.html">Bug20030</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug20178.html">Bug20178</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug20199.html">Bug20199</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug21186.html">Bug21186</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug21318.html">Bug21318</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug21424.html">Bug21424</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug21689.html">Bug21689</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug21692.html">Bug21692</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug21779.html">Bug21779</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug22025.html">Bug22025</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug22142.html">Bug22142</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug22157.html">Bug22157</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug23529.html">Bug23529</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug23680.html">Bug23680</a></font></font></td>
</tr>
<tr>
<td><font face="Verdana"><font size=-1><a href="Bug23780.html">Bug23780</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug23831.html">Bug23831</a></font></font></td>
<td><font face="Verdana"><font size=-1><a href="Bug24003.html">Bug24003</a></font></font></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<p>
<hr WIDTH="100%">
<table WIDTH="100%" BGCOLOR="#FFFFFF" >
<tr>
<td VALIGN=TOP><font face="Verdana"><font size=-2>Residual style:&nbsp;</font></font></td>
<td><font face="Verdana"><font size=-2>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.</font></font></td>
</tr>
</table>
</body>
</html>