layout/reftests/bugs/398682-1.html

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <script>
michael@0 5
michael@0 6 function boom()
michael@0 7 {
michael@0 8 // Only this exact number of calls to bounce() triggers the bug,
michael@0 9 // but changing the depth of the document changes the number of
michael@0 10 // bounce() calls needed. For example, removing the 'p' tag
michael@0 11 // makes it so one additional bounce() is needed.
michael@0 12
michael@0 13 for (var i = 0; i < 7; ++i)
michael@0 14 bounce();
michael@0 15
michael@0 16 var tr = document.getElementById("tr");
michael@0 17 tr.style.display = "none";
michael@0 18 document.documentElement.offsetHeight;
michael@0 19 bounce();
michael@0 20 document.documentElement.offsetHeight;
michael@0 21 tr.style.display = "";
michael@0 22
michael@0 23 document.documentElement.offsetHeight;
michael@0 24
michael@0 25 var td = document.getElementById("td");
michael@0 26 td.style.display = "none";
michael@0 27 document.documentElement.offsetHeight;
michael@0 28 bounce();
michael@0 29 document.documentElement.offsetHeight;
michael@0 30 td.style.display = "";
michael@0 31 }
michael@0 32
michael@0 33
michael@0 34 function bounce()
michael@0 35 {
michael@0 36 var docElem = document.documentElement;
michael@0 37 var docElemChildren = [];
michael@0 38 while (docElem.firstChild) {
michael@0 39 docElemChildren.push(docElem.firstChild);
michael@0 40 docElem.removeChild(docElem.firstChild);
michael@0 41 }
michael@0 42
michael@0 43 for (var i = 0; i < docElemChildren.length; ++i)
michael@0 44 docElem.appendChild(docElemChildren[i]);
michael@0 45 }
michael@0 46
michael@0 47 </script>
michael@0 48
michael@0 49 <style type="text/css">
michael@0 50 #a { color: orange; }
michael@0 51 #b { color: blue; }
michael@0 52 </style>
michael@0 53
michael@0 54 </head>
michael@0 55
michael@0 56 <body onload="boom();">
michael@0 57 <table border="10"><tr id="tr"><td id="td">
michael@0 58 <p><span id="a">a</span><span id="b">b</span></p>
michael@0 59 </td></tr></table>
michael@0 60 </body>
michael@0 61
michael@0 62 </html>

mercurial