1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

Add Percentage, and font-size (not all styles fully realized yet though).

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@242 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-14 02:08:45 +00:00
parent 76b593e060
commit 0170bb2120
6 changed files with 75 additions and 2 deletions

View File

@@ -31,6 +31,9 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
$this->assertDef('letter-spacing:2px;');
$this->assertDef('word-spacing:normal;');
$this->assertDef('word-spacing:3em;');
$this->assertDef('font-size:200%;');
$this->assertDef('font-size:larger;');
$this->assertDef('font-size:12pt;');
// duplicates
$this->assertDef('text-align:right;text-align:left;',

View File

@@ -0,0 +1,26 @@
<?php
require_once 'HTMLPurifier/AttrDef/Percentage.php';
class HTMLPurifier_AttrDef_PercentageTest extends HTMLPurifier_AttrDefHarness
{
function test() {
$this->def = new HTMLPurifier_AttrDef_Percentage();
$this->assertDef('10%');
$this->assertDef('1.607%');
$this->assertDef('-567%');
$this->assertDef(' 100% ', '100%');
$this->assertDef('5', false);
$this->assertDef('asdf', false);
$this->assertDef('%', false);
}
}
?>

View File

@@ -69,6 +69,7 @@ $test_files[] = 'AttrDef/ColorTest.php';
$test_files[] = 'AttrDef/IntegerTest.php';
$test_files[] = 'AttrDef/NumberTest.php';
$test_files[] = 'AttrDef/CSSLengthTest.php';
$test_files[] = 'AttrDef/PercentageTest.php';
$test_files[] = 'IDAccumulatorTest.php';
$test_files[] = 'TagTransformTest.php';
$test_files[] = 'AttrTransform/LangTest.php';