2 <script src=
"../../../resources/js-test.js"></script>
6 description('Tests that moving an element between documents with different quirks mode works');
8 var htmlElement
= document
.createElement('div');
9 htmlElement
.className
= "A a B";
11 debug('In standards mode');
12 shouldBeTrue('htmlElement.classList.contains("A")');
13 shouldBeTrue('htmlElement.classList.contains("a")');
14 shouldBeTrue('htmlElement.classList.contains("B")');
15 shouldBeFalse('htmlElement.classList.contains("b")');
17 var doc
= frames
[0].document
;
19 doc
.write('<body></body>');
22 debug('Moved to quirks mode');
23 doc
.body
.appendChild(htmlElement
);
24 shouldBeTrue('htmlElement.classList.contains("A")');
25 shouldBeTrue('htmlElement.classList.contains("a")');
26 shouldBeTrue('htmlElement.classList.contains("B")');
27 shouldBeFalse('htmlElement.classList.contains("b")');
29 debug('Moved back to standards mode');
30 document
.body
.appendChild(htmlElement
);
31 shouldBeTrue('htmlElement.classList.contains("A")');
32 shouldBeTrue('htmlElement.classList.contains("a")');
33 shouldBeTrue('htmlElement.classList.contains("B")');
34 shouldBeFalse('htmlElement.classList.contains("b")');