Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 #parent { | |
| 4 height: 100px; | |
| 5 } | |
| 6 #container { | |
| 7 display: inline-block; | |
| 8 height: 100%; | |
| 9 } | |
| 10 img { | |
| 11 display: block; | |
| 12 min-height: 100%; | |
| 13 width: auto; | |
| 
 
mstensho (USE GERRIT)
2017/04/19 10:58:47
width and height are initially auto, so no need to
 
 | |
| 14 height: auto; | |
| 15 } | |
| 16 </style> | |
| 17 | |
| 18 <p> | |
| 19 Tests that resizing inline-block container element | |
| 20 when img with width: auto and height: auto resizes | |
| 21 </p> | |
| 22 | |
| 23 <div style="height:100px"> | |
| 24 <div id="parent"> | |
| 25 <div id="container" data-expected-width="25" data-expected-height="50"> | |
| 26 <img src='data:image/svg+xml;utf8,<svg height="2px" width="1px" xmlns="htt p://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1 "></svg>'></img> | |
| 27 </div> | |
| 28 </div> | |
| 29 </div> | |
| 30 | |
| 31 <script src="../../resources/check-layout.js"></script> | |
| 
 
mstensho (USE GERRIT)
2017/04/19 10:58:47
Please consider using testharness when writing che
 
 | |
| 32 | |
| 33 <script> | |
| 34 function runTest() { | |
| 
 
mstensho (USE GERRIT)
2017/04/19 10:58:47
Seems that you can just do all these things right
 
 | |
| 35 document.body.offsetTop; | |
| 36 var parent = document.getElementById('parent'); | |
| 37 parent.style.height = "50px"; | |
| 38 document.body.offsetTop; | |
| 39 checkLayout("#container"); | |
| 40 } | |
| 41 window.onload = runTest; | |
| 42 </script> | |
| OLD | NEW |