Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <meta charset="utf-8"> | |
| 3 <title>CSS Display 3: Display contents reattachment works well in Flex items</ti tle> | |
| 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:ecobos@igalia.com"> | |
| 5 <link rel="help" href="http://dev.w3.org/csswg/css-display"> | |
| 6 <style> | |
| 7 .flex { | |
| 8 display: flex; | |
| 9 } | |
| 10 .inline { | |
| 11 display: inline; | |
| 12 } | |
| 13 .contents { | |
| 14 display: contents; | |
| 15 } | |
| 16 </style> | |
| 17 <div class="flex"> | |
| 18 0 | |
| 19 <div class="contents"> | |
| 20 <div>1</div> | |
| 21 </div> | |
| 22 <div class="contents"> | |
| 23 <div class="inline">2<div>2</div></div> | |
| 24 </div> | |
| 25 <div class="contents"> | |
| 26 3 | |
| 27 </div> | |
| 28 <div class="inline">3</div> | |
| 29 </div> | |
| 30 <script> | |
| 31 var TIMEOUT = 100; | |
|
rune
2016/11/18 10:35:39
This smells flakiness. Why do you need to use a ti
emilio
2016/11/18 10:54:35
Whoops, that's right. It's not needed, just was ea
| |
| 32 window.onload = function() { | |
| 33 setTimeout(() => { | |
| 34 var elements = []; | |
| 35 var all = document.querySelectorAll('*'); | |
| 36 for (var i = 0; i < all.length; ++i) { | |
| 37 if (window.getComputedStyle(all[i]).display == 'contents') { | |
| 38 elements.push(all[i]); | |
| 39 all[i].style.display = 'none'; | |
| 40 } | |
| 41 } | |
| 42 document.body.offsetHeight; | |
| 43 setTimeout(() => { | |
| 44 elements.forEach(e => e.style.display = ''); | |
| 45 }, TIMEOUT); | |
| 46 }, TIMEOUT); | |
| 47 } | |
| 48 </script> | |
| OLD | NEW |