| <!-- Submitted from TestTWF Paris --> |
| <!DOCTYPE html> |
| <html class="reftest-wait"> |
| <head> |
| <title>CSS Values and Units Test: vh-based dimension doesn't change when the element's other dimension doesn't change.</title> |
| <meta name="timeout" content="long"> |
| <link rel="author" title="Marc Bourlon" href="mailto:marc@bourlon.com"> |
| <link rel="help" href="http://www.w3.org/TR/css3-values/#viewport-relative-lengths"> |
| <link rel="match" href="reference/vh_not_refreshing_on_chrome-ref.html"> |
| <meta charset="UTF-8"> |
| <meta name="assert" content="vh-based dimension doesn't change when the element's other dimension doesn't change."> |
| <!-- This test exhibits a bug for Chrome 19.0.1084.56 / Mac OS X 10.6.8 --> |
| <script src="/common/reftest-wait.js"></script> |
| |
| <style type="text/css"> |
| |
| * { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 13px; } |
| |
| #frameTest { width: 600px; height: 200px; border: 1px solid #000; } |
| |
| </style> |
| |
| <script type="text/javascript"> |
| 'use strict'; |
| |
| // We must not capture the screen until the frameTest, referenceBoxGrownHorizontallyByJS |
| // and testBoxWithTransition elements have finished changing height. |
| var elementsPending = 3; |
| function receiveMessage() { |
| if (--elementsPending === 0) { |
| takeScreenshot(); |
| } |
| } |
| |
| window.addEventListener('message', receiveMessage, false); |
| |
| var height = 200; |
| |
| function resizeReference() { |
| |
| var frameTest = document.getElementById('frameTest'); |
| |
| // let's resize the iframe vertically only, showing that the vh sizes is not updated. |
| if (height < 300) { |
| |
| //frameTest.style.width = height++ + "px"; |
| frameTest.style.height = ++height + "px"; |
| |
| setTimeout(resizeReference, 10); |
| |
| } else { |
| |
| // uncomment the next line to see how a width resize triggers a layout recalculation |
| //frameTest.style.width = (parseInt(window.getComputedStyle(document.getElementById('frameTest'))['width'], 10) + 1) + "px"; |
| |
| window.postMessage('frameTest', '*'); |
| } |
| |
| } |
| |
| setTimeout(resizeReference, 10); |
| </script> |
| |
| </head> |
| <body> |
| |
| <iframe id="frameTest" src="support/vh_not_refreshing_on_chrome_iframe.html" frameborder="0"></iframe> |
| |
| </body> |
| </html> |