| // Check if the two divs aren't overflowed by checking they have |
| var ref = document.getElementById("ref"); |
| var test = document.getElementById("test"); |
| var result = document.getElementById("result"); |
| if (ref.scrollHeight == test.scrollHeight) |
| result.appendChild(document.createTextNode("SUCCESS")); |
| result.appendChild(document.createTextNode("FAILED")); |
| These two lines should look same as spaces after a list marker should |
| be ignored. There are 18 characters in each line. As they are 20px |
| width, the total width should be 360px + a few pixels for table. |
| If the space character after the list marker in "test" isn't ignored, |
| the number of characters become 19 and 370px div will be overflowed. |
| Note that this test requires Ahem font. |
| <div style="height: 20px; overflow-y: scroll;" id="ref"> |
| <table style="width: 370px; font: 20px Ahem;"> |
| <td><ol><li>XpX XpX</ol></td> |
| <td><ol><li>XpX XpX</ol></td> |
| <div style="height: 20px; overflow-y: scroll;" id="test"> |
| <table style="width: 370px; font: 20px Ahem;"> |
| <td><ol><li> XpX XpX</ol></td> |
| <td><ol><li>XpX XpX</ol></td> |