From f985d3cd9632099390287e6ba4545ec2c84fa261 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 29 May 2007 00:39:00 +0000 Subject: [PATCH] Add initial allElements smoketest. Incomplete. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1112 48356398-32a2-884e-a903-53898d9a118a --- smoketests/allElements.css | 48 ++++++++++++++++++++++ smoketests/allElements.html | 79 +++++++++++++++++++++++++++++++++++++ smoketests/allElements.php | 28 +++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 smoketests/allElements.css create mode 100644 smoketests/allElements.html create mode 100644 smoketests/allElements.php diff --git a/smoketests/allElements.css b/smoketests/allElements.css new file mode 100644 index 00000000..874c094c --- /dev/null +++ b/smoketests/allElements.css @@ -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;} \ No newline at end of file diff --git a/smoketests/allElements.html b/smoketests/allElements.html new file mode 100644 index 00000000..b476f813 --- /dev/null +++ b/smoketests/allElements.html @@ -0,0 +1,79 @@ + + + + + HTML Purifier All Elements Smoketest Test Data + + + + + +

HTML Purifier All Elements Smoketest Test Data

+ +

This file includes all the test data for the all elements smoke +test. It is divided by XHTML 1.1 style modules. Make sure +div, span and id are allowed, +otherwise there will be problems.

+ +

Core attributes

+
+
id
+
class
+
title
+
lang
+
xml:lang (green when lang also present)
+
style
+
onclick (and other event handlers)
+
+ +

Text module

+
+ abbr + acronym +
blockquote
+
blockquote@cite
+
+ cite + code + dfn + em +

h1

+

h2

+

h3

+

h4

+
h5
+
h6
+ kbd +

p

+
pre
+ q + q@cite + samp + strong + var +
+ +

Hypertext module

+
+ a: + accesskey + charset + href + hreflang + rel + rev + tabindex + type +
+ +

List module

+
+
dl dt
dl dd
+
  1. ol li
+ +
+ + + \ No newline at end of file diff --git a/smoketests/allElements.php b/smoketests/allElements.php new file mode 100644 index 00000000..faa600da --- /dev/null +++ b/smoketests/allElements.php @@ -0,0 +1,28 @@ +'; +?> + + + HTML Purifier UTF-8 Smoketest + + + + +set('Attr', 'EnableID', true); + +$purifier = new HTMLPurifier($config); +echo $purifier->purify(file_get_contents('allElements.html')); + +?> + + \ No newline at end of file