0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00
htmlpurifier/tests/HTMLPurifier
Edward Z. Yang 0767bbc12d Rewrite FixNesting implementation to be tree-based.
This mega-patch rips out the FixNesting implementation and the related
ChildDef components.  The primary algorithmic change is to convert from
use of tokens to tree nodes, which are far more amenable to the style
of processing that FixNesting uses.  Additionally, FixNesting has been
changed to go bottom-up rather than top-down, in order to avoid needing
to implement backtracking.

This patch simplifies a good deal of the relevant logic, since we no
longer need to continually recalculate the nesting structure when
processing things.  However, the conversion to the alternate format
incurs some overhead, so for small inputs these changes are not a win.
One possibility to greatly reduce the constant factors here is to switch
to entirely using libxml's representation, and never serializing tokens;
this would require one to rewrite injectors, however.

The iterative post-order traversal in FixNesting is a bit subtle, but
we have essentially reified the stack and continuations.

We've removed support for %Core.EscapeInvalidChildren.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
2013-10-20 22:37:01 -07:00
..
AttrDef PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrTransform PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ChildDef Rewrite FixNesting implementation to be tree-based. 2013-10-20 22:37:01 -07:00
ConfigSchema PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
DefinitionCache PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
Filter PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLModule PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLT Properly use HMAC for secure munging. 2013-09-13 21:16:50 -07:00
Injector PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
Lexer PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
PHPT Improve gitignore. 2013-10-13 00:18:11 -07:00
SimpleTest PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
Strategy Rewrite FixNesting implementation to be tree-based. 2013-10-20 22:37:01 -07:00
StringHashParser Add vim modelines to all files. 2008-12-06 04:24:59 -05:00
URIFilter Properly use HMAC for secure munging. 2013-09-13 21:16:50 -07:00
VarParser PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrCollectionsTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrDefHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrDefTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrTransformHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrTransformTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrTypesTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
AttrValidator_ErrorsTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ChildDefHarness.php Rewrite FixNesting implementation to be tree-based. 2013-10-20 22:37:01 -07:00
ComplexHarness.php Rewrite FixNesting implementation to be tree-based. 2013-10-20 22:37:01 -07:00
ConfigSchemaTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ConfigTest-create.ini Add vim modelines to all files. 2008-12-06 04:24:59 -05:00
ConfigTest-finalize.ini Add vim modelines to all files. 2008-12-06 04:24:59 -05:00
ConfigTest-loadIni.ini Add vim modelines to all files. 2008-12-06 04:24:59 -05:00
ConfigTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ContextTest.php Properly handle context variables that are NULL. 2013-10-13 13:21:02 -07:00
DefinitionCacheFactoryTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
DefinitionCacheHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
DefinitionCacheTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
DefinitionTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
DefinitionTestable.php Add vim modelines to all files. 2008-12-06 04:24:59 -05:00
DoctypeRegistryTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ElementDefTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
EncoderTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
EntityLookupTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
EntityParserTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ErrorCollectorEMock.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ErrorCollectorTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ErrorsHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
GeneratorTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
Harness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLDefinitionTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLModuleHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLModuleManagerTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLModuleTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
HTMLT.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
IDAccumulatorTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
InjectorHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
LanguageFactoryTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
LanguageTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
LengthTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
LexerTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
PercentEncoderTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
PropertyListTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
StrategyHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
StringHashParserTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
StringHashTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
TagTransformTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
TokenFactoryTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
TokenTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
UnitConverterTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URIDefinitionTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URIFilterHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URIHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URIParserTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URISchemeRegistryTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URISchemeTest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
URITest.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
VarParserHarness.php PSR-2 reformatting PHPDoc corrections 2013-08-17 22:27:26 -04:00
ZipperTest.php Use a Zipper to process MakeWellFormed, removing quadratic behavior. 2013-10-13 13:21:02 -07:00