Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / getComputedStyle / zoom-on-display-none.html
blob05455d9c537e8a9f9bca533535b7a04c56b812c2
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpAsText();
6 </script>
7 <style>
8 .test_div {
9 zoom: 2;
10 width: 300px;
13 #zoomed_and_displayed {
14 background: #ccc;
16 #zoomed_and_hidden {
17 display: none;
18 background: orange;
20 </style>
21 </head>
22 <body>
24 <div id="result">FAIL.</div>
25 <br/>
27 <div id="zoomed_and_displayed" class="test_div">
28 This div has a zoom value of "2." It has a width of 300px.
29 </div>
30 <div id="zoomed_and_hidden" class="test_div">
31 This div is has a zoom value of "2" and is hidden. It has a width of 300px.
32 </div>
34 <script type="text/javascript" charset="utf-8">
35 var zoomedAndDisplayed = document.getElementById("zoomed_and_displayed");
36 var zoomedAndHidden = document.getElementById("zoomed_and_hidden");
37 var renderedWidth = zoomedAndDisplayed.scrollWidth;
38 var computedWidthDisplayed = parseFloat(document.defaultView.getComputedStyle(zoomedAndDisplayed).width);
39 var computedWidthHidden = parseFloat(document.defaultView.getComputedStyle(zoomedAndHidden).width);
41 var result = document.getElementById("result");
42 if (computedWidthHidden == computedWidthDisplayed && computedWidthDisplayed == renderedWidth)
43 result.innerHTML = "PASS! Neither the computed width of the displayed div nor the computed width of the display:none div has been affected by the zoom factor.";
44 </script>
46 </body>
47 </html>