Created
October 14, 2010 01:11
-
-
Save Freaken/625332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>bug</title> | |
<script type="text/javascript"> | |
function trigger_bug() { | |
var div = document.createElement("div"); | |
document.body.appendChild( div ); | |
// These two lines break something. | |
// Remove any of them, and the bug does not appear. | |
// They have to be in this order too. | |
div.offsetWidth; | |
div.style.display = 'none'; | |
} | |
function show_bug() { | |
var element = document.createElement("div"); | |
var selector = document.getElementById("selector"); | |
selector.appendChild(element); | |
} | |
function execute() { | |
trigger_bug(); | |
show_bug(); | |
} | |
</script> | |
</head> | |
<body onload="javascript:execute();"> | |
<div style="float: left; border: 1px solid black;"> | |
<div id="selector" style="width: 50px; height: 50px; overflow-y: scroll;"> | |
test | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment