summaryrefslogtreecommitdiff
path: root/test/HTML5/Serializer/OutputRulesTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/HTML5/Serializer/OutputRulesTest.php')
-rw-r--r--test/HTML5/Serializer/OutputRulesTest.php28
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">