1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-16 19:13:58 +02:00

[1.7.0] Fix bug in Bool class

- Genericize allElements into basic smoketest, add beginnings of legacy smoketest too.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1113 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-05-29 02:12:08 +00:00
parent f985d3cd96
commit 9c5f01a0cf
7 changed files with 207 additions and 32 deletions

View File

@@ -0,0 +1,48 @@
div > * {background:#F00; color:#FFF; font-weight:bold; padding:0.2em; margin:0.1em;}
#core-attributes #core-attributes-id,
#core-attributes .core-attributes-class,
#core-attributes div[title='tooltip'],
#core-attributes div[lang='en'],
#core-attributes div[onclick="alert('foo');"],
#module-text abbr,
#module-text acronym,
#module-text div blockquote,
#module-text blockquote[cite='http://www.example.com'],
#module-text br,
#module-text cite,
#module-text code,
#module-text dfn,
#module-text em,
#module-text h1,
#module-text h2,
#module-text h3,
#module-text h4,
#module-text h5,
#module-text h6,
#module-text kbd,
#module-text p,
#module-text pre,
#module-text span q,
#module-text q[cite='http://www.example.com'],
#module-text samp,
#module-text strong,
#module-text var,
#module-hypertext span a,
#module-hypertext a[accesskey='q'],
#module-hypertext a[charset='UTF-8'],
#module-hypertext a[href='http://www.example.com/'],
#module-hypertext a[hreflang='en'],
#module-hypertext a[rel='nofollow'],
#module-hypertext a[rev='index'],
#module-hypertext a[tabindex='1'],
#module-hypertext a[type='text/plain'],
#module-list dl,
#module-list ul,
#module-list ol,
#module-list li,
#module-list dd,
#module-list dt,
.insert-declarations-above
{background:#008000; margin:0; padding:0.2em;}
#module-text span, #module-text div {padding:0; margin:0.1em;}
#module-list li, #module-list dd, #module-list dt {border:1px solid #FFF;}

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>HTML Purifier All Elements Smoketest</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="allElements.css" type="text/css" />
</head>
<body>
<h1>HTML Purifier All Elements Smoketest</h1>
<p>This is the all elements smoke
test. It is divided by XHTML 1.1 style modules. Make sure
<code>div</code>, <code>span</code> and <code>id</code> are allowed,
otherwise there will be problems.</p>
<h2>Core attributes</h2>
<div id="core-attributes">
<div id="core-attributes-id">id</div>
<div class="core-attributes-class">class</div>
<div title="tooltip">title</div>
<div lang="en">lang</div>
<div xml:lang="en">xml:lang (green when lang also present)</div>
<div style="background:#008000">style</div>
<div onclick="alert('foo');">onclick (and other event handlers)</div>
</div>
<h2>Text module</h2>
<div id="module-text">
<abbr>abbr</abbr>
<acronym>acronym</acronym>
<div><blockquote>blockquote</blockquote></div>
<blockquote cite="http://www.example.com">blockquote@cite</blockquote>
<br />
<cite>cite</cite>
<code>code</code>
<dfn>dfn</dfn>
<em>em</em>
<h1>h1</h1>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
<h6>h6</h6>
<kbd>kbd</kbd>
<p>p</p>
<pre>pre</pre>
<span><q>q</q></span>
<q cite="http://www.example.com">q@cite</q>
<samp>samp</samp>
<strong>strong</strong>
<var>var</var>
</div>
<h2>Hypertext module</h2>
<div id="module-hypertext">
<span><a>a</a></span>:
<a accesskey="q">accesskey</a>
<a charset="UTF-8">charset</a>
<a href="http://www.example.com/">href</a>
<a hreflang="en">hreflang</a>
<a rel="nofollow">rel</a>
<a rev="index">rev</a>
<a tabindex="1">tabindex</a>
<a type="text/plain">type</a>
</div>
<h2>List module</h2>
<div id="module-list">
<dl><dt>dl dt</dt><dd>dl dd</dd></dl>
<ol><li>ol li</li></ol>
<ul><li>ul li</li></ul>
</div>
</body>
</html>

View File

@@ -0,0 +1,32 @@
center,
dir[compact='compact'],
isindex[prompt='Foo'],
menu[compact='compact'],
s,
u,
strike,
caption[align='bottom'],
div[align='center'],
dl[compact='compact'],
h1[align='right'],
h2[align='right'],
h3[align='right'],
h4[align='right'],
h5[align='right'],
h6[align='right'],
hr[align='right'],
hr[noshade='noshade'],
hr[width='50'],
hr[size='50'],
.insert-declarations-above
{background:#008000; color:#FFF; font-weight:bold;}
font {background:#BFB;}
u {border:1px solid #000;}
hr {height:1em;}
hr[size='50'] {height:50px;}

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>HTML Purifier Legacy Smoketest Test Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="legacy.css" type="text/css" />
</head>
<body>
<h1>HTML Purifier Legacy Smoketest Test Data</h1>
<p>This is the legacy smoketest.</p>
<h2>Elements</h2>
<div>
<div>
<basefont color="green" face="Arial" size="6" id="basefont" />
basefont: Green, Arial, size 6 text (IE-only)
</div>
<center>center</center>
<dir compact="compact">
<li>dir</li>
</dir>
<font color="green" face="Arial" size="6">font: Green, Arial, size 6 text</font>
isindex:
<isindex prompt="Foo" />
<menu compact="compact">
<li>menu</li>
</menu>
<s>s</s> <strike>strike</strike> <u>u</u>
</div>
<h2>Attributes</h2>
<div>
<!-- body -->
<div style="font-size:42pt; float:left;">*</div>
<br clear="left" />
<p>br@clear (asterisk is up)</p>
<table>
<caption align="bottom">caption@align</caption>
<tr><td>Cell</td></tr>
</table>
<div align="center">div@center</div>
<dl compact="compact">
<dt>dl@compact</dt>
</dl>
<h1 align="right">h1</h1>
<h2 align="right">h2</h2>
<h3 align="right">h3</h3>
<h4 align="right">h4</h4>
<h5 align="right">h5</h5>
<h6 align="right">h6</h6>
hr@align
<hr align="right" width="50" />
hr@noshade
<hr noshade="noshade" />
hr@width
<hr width="50" />
hr@size
<hr size="50" />
</div>
<!--
img& align ("top" | "middle" | "bottom" | "left" | "right"), border (Pixels), hspace (Pixels), vspace (Pixels)
input& align ("top" | "middle" | "bottom" | "left" | "right") When the Basic Forms or Forms Module is selected.
legend& align ("left" | "center" | "right" | "justify") When the Forms Module is selected.
li& type (CDATA), value (Number)
ol& compact ("compact"), start (Number), type (CDATA)
p& align ("left" | "center" | "right", "justify")
pre& width (Number)
script& language (CDATA) When the Scripting module is selected.
table& align ("left" | "center" | "right"), bgcolor (Color) When the Tables module is selected.
tr& bgcolor (Color) When the Tables module is selected.
th& bgcolor (Color), height (Length) nowrap ("nowrap"), width (Length) When the Tables module is selected.
td& bgcolor (Color), height (Length) nowrap ("nowrap"), width (Length) When the Tables module is selected.
ul& compact ("compact"), type (CDATA)
-->
</body>
</html>