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