diff options
author | Matt Farina <[email protected]> | 2014-06-09 20:57:17 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2014-06-09 20:57:17 -0400 |
commit | d7cb5f181fe48025a3a2e7f0c7d6cd2acf8cd3d0 (patch) | |
tree | 89d3357096e85aa2f6b9716675e47e75afa1699e /test/HTML5/Serializer/OutputRulesTest.php | |
parent | 04f2b92e763b08d338268ce0818554616b7141cd (diff) |
#32 Fixed bug where character references were being encoded in style tags.
Diffstat (limited to 'test/HTML5/Serializer/OutputRulesTest.php')
-rw-r--r-- | test/HTML5/Serializer/OutputRulesTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php index 9a022c5..6ef8304 100644 --- a/test/HTML5/Serializer/OutputRulesTest.php +++ b/test/HTML5/Serializer/OutputRulesTest.php @@ -131,6 +131,34 @@ class OutputRulesTest extends \HTML5\Tests\TestCase { </script>', stream_get_contents($stream, -1, 0)); } + function testElementWithStyle() { + $dom = \HTML5::loadHTML('<!doctype html> + <html lang="en"> + <head> + <style> + body > .bar { + display: none; + } + </style> + </head> + <body> + <div id="foo" class="bar baz">foo bar baz</div> + </body> + </html>'); + + $stream = fopen('php://temp', 'w'); + $r = new OutputRules($stream, \HTML5::options()); + $t = new Traverser($dom, $stream, $r, \HTML5::options()); + + $style = $dom->getElementsByTagName('style'); + $r->element($style->item(0)); + $this->assertEquals('<style> + body > .bar { + display: none; + } + </style>', stream_get_contents($stream, -1, 0)); + } + function testOpenTag() { $dom = \HTML5::loadHTML('<!doctype html> <html lang="en"> |