summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Farina <[email protected]>2013-06-28 08:39:17 -0400
committerMatt Farina <[email protected]>2013-06-28 08:39:17 -0400
commit5081159654f0b1d9d66cb7f540dbe9b5bd4ae3aa (patch)
tree9f442e82e26f395818f33ac1387080c595e02073
parent5921b94e0a6b5c1abb3ecf6a25e2292bca68a58b (diff)
Added a test around prefixed xml. It's a weird and invalid case. But, following the naming conventions in 2.9 means parsing and spitting it out works though each element is treated as an unknown element.
-rw-r--r--test/HTML5/Html5Test.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php
index 14fcb2d..844d7fc 100644
--- a/test/HTML5/Html5Test.php
+++ b/test/HTML5/Html5Test.php
@@ -166,4 +166,21 @@ class Html5Test extends TestCase {
$this->assertRegExp('|<mi>y</mi>|',$html);
}
+ public function testUnknownElements() {
+
+ // The : should not have special handling accourding to section 2.9 of the
+ // spec. This is differenant than XML. Since we don't know these elements
+ // they are handled as normal elements. Note, to do this is really
+ // an invalid example and you should not embed prefixed xml in html5.
+ $dom = \HTML5::loadHTMLFragment("<f:rug>
+ <f:name>Big rectangle thing</f:name>
+ <f:width>40</f:width>
+ <f:length>80</f:length>
+ </f:rug>");
+
+ $this->assertEmpty($dom->errors);
+ $markup = \HTML5::saveHTML($dom);
+ $this->assertRegExp('|<f:name>Big rectangle thing</f:name>|',$markup);
+ }
+
}