Skip to content

Instantly share code, notes, and snippets.

@Freaken
Created October 14, 2010 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Freaken/625332 to your computer and use it in GitHub Desktop.
Save Freaken/625332 to your computer and use it in GitHub Desktop.
<!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