| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script src="script-tests/mark-element.js"></script> | 7 <script> |
| 8 description('Various tests for the mark element.'); |
| 9 |
| 10 var testParent = document.createElement('div'); |
| 11 document.body.appendChild(testParent); |
| 12 |
| 13 debug('<p> closes <mark>:'); |
| 14 testParent.innerHTML = '<mark>Test that <p id="paragraph1">a p element</p> close
s <mark>.</p>'; |
| 15 var paragraph1 = document.getElementById('paragraph1'); |
| 16 shouldBeFalse('paragraph1.parentNode.nodeName == "mark"'); |
| 17 |
| 18 debug('<b> does not close <mark>:'); |
| 19 testParent.innerHTML = '<mark>Test that <b id="b1">a b element</b> does not clos
e a mark element.</mark>'; |
| 20 var b1 = document.getElementById('b1'); |
| 21 shouldBe('b1.parentNode.nodeName', '"MARK"'); |
| 22 |
| 23 debug('Residual style:'); |
| 24 testParent.innerHTML = '<b><mark id="mark2">This text should be bold.</mark> <sp
an id="span1">This is also bold.</span></b>'; |
| 25 function getWeight(id) { |
| 26 return document.defaultView.getComputedStyle(document.getElementById(id), nu
ll).getPropertyValue('font-weight'); |
| 27 } |
| 28 shouldBe('getWeight("mark2")', '"bold"'); |
| 29 shouldBe('getWeight("span1")', '"bold"'); |
| 30 document.body.removeChild(testParent); |
| 31 </script> |
| 8 </body> | 32 </body> |
| 9 </html> | 33 </html> |
| OLD | NEW |