diff options
author | Matt Farina <[email protected]> | 2016-03-18 08:59:57 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2016-03-18 08:59:57 -0400 |
commit | 432908f65e72820f9393f07d6e47061532a9047b (patch) | |
tree | cf5b8ec7f0f05e6f4bfda5984944c396ebc9c518 /test/HTML5 | |
parent | bb79919ffc7df4914ff5a489cf2ad2ad0602ff88 (diff) |
Fixes #98: a DOM is allowed within noscript tags
When JavaScript is disabled noscript tags become transparent to
to the DOM. For more details see:
https://w3c.github.io/html/semantics-scripting.html#the-noscript-element
While this notes limitations in the values in the head there are
different sets elsewhere such as in:
https://w3c.github.io/html/syntax.html#the-in-head-noscript-insertion-mode
Since this is not a validating parser this handling it to make it
transparent.
Diffstat (limited to 'test/HTML5')
-rw-r--r-- | test/HTML5/Parser/DOMTreeBuilderTest.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index b2a2d39..d0bea5f 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -100,7 +100,7 @@ class DOMTreeBuilderTest extends \Masterminds\HTML5\Tests\TestCase $this->assertSame($doc, $targetDom); $this->assertEquals('html', $doc->documentElement->tagName); } - + public function testDocumentFakeAttrAbsence() { $html = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><body>foo</body></html>"; @@ -495,6 +495,12 @@ class DOMTreeBuilderTest extends \Masterminds\HTML5\Tests\TestCase $this->assertEmpty($this->errors); $noscript = $doc->getElementsByTagName('noscript')->item(0); $this->assertEquals('noscript', $noscript->tagName); + + $html = '<!DOCTYPE html><html><body><noscript><p>No JS</p></noscript></body></html>'; + $doc = $this->parse($html); + $this->assertEmpty($this->errors); + $p = $doc->getElementsByTagName('p')->item(0); + $this->assertEquals('p', $p->tagName); } /** |