| <title>layout zoom test</title> |
| The box above should be navy blue with no banding effects.<br> |
| var testElement = document.getElementById('test'); |
| var consoleElement = document.getElementById('console'); |
| testElement.innerHTML = ''; |
| for (var i = 0; i < 100; i++) |
| testElement.appendChild(document.createElement('div')); |
| testElement.style.zoom = zoom + '%'; |
| var lastElementBottom = testElement.lastChild.getBoundingClientRect().bottom; |
| var containerBottom = testElement.getBoundingClientRect().bottom; |
| var tolerance = Math.ceil(1 / (zoom / 100)); |
| if (Math.abs(lastElementBottom - containerBottom) <= tolerance) |
| log('PASS: With zoom of ' + zoom + '% bottom edge of last child lines up with bottom edge of container.'); |
| log('FAIL: With zoom of ' + zoom + '% bottom edge of last child at ' + lastElementBottom + ', container at ' + containerBottom + '.'); |
| consoleElement.appendChild(document.createTextNode(str)); |
| consoleElement.appendChild(document.createElement('br')); |