@@ -2,20 +2,28 @@ const assert = require('../assert.js').for('XMLDocument');
22
33const { DOMParser} = global [ Symbol . for ( 'linkedom' ) ] ;
44
5- const document = ( new DOMParser ) . parseFromString ( '<root></root>' , 'text/xml' ) ;
5+ {
6+ const document = ( new DOMParser ) . parseFromString ( '<root></root>' , 'text/xml' ) ;
67
7- assert ( document . toString ( ) , '<?xml version="1.0" encoding="utf-8"?><root />' ) ;
8+ assert ( document . toString ( ) , '<?xml version="1.0" encoding="utf-8"?><root />' ) ; ;
89
9- assert ( document . documentElement . tagName , 'root' ) ;
10- assert ( document . documentElement . nodeName , 'root' ) ;
10+ assert ( document . documentElement . tagName , 'root' ) ;
11+ assert ( document . documentElement . nodeName , 'root' ) ;
1112
1213
13- document . documentElement . innerHTML = `
14+ document . documentElement . innerHTML = `
1415<Something>
1516 <Element>Text</Element>
1617 <Element>Text</Element>
1718</Something>
1819` . trim ( ) ;
1920
20- assert ( document . querySelectorAll ( 'Element' ) . length , 2 , 'case sesntivive 2' ) ;
21- assert ( document . querySelectorAll ( 'element' ) . length , 0 , 'case sesntivive 0' ) ;
21+ assert ( document . querySelectorAll ( 'Element' ) . length , 2 , 'case sensitive 2' ) ;
22+ assert ( document . querySelectorAll ( 'element' ) . length , 0 , 'case sensitive 0' ) ;
23+ }
24+
25+ {
26+ const document = ( new DOMParser ) . parseFromString ( '<root checked attr="&<>"></root>' , 'text/xml' ) ;
27+ assert ( document . toString ( ) , '<?xml version="1.0" encoding="utf-8"?><root checked attr="&<>" />' ) ;
28+ }
29+
0 commit comments