Skip to content

Instantly share code, notes, and snippets.

@leo60228
Created August 11, 2022 21:58
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 leo60228/678632135129d0b840f9e5705854b707 to your computer and use it in GitHub Desktop.
Save leo60228/678632135129d0b840f9e5705854b707 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<script>
function prepare() {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
var doc = iframe.contentDocument;
doc.body.innerHTML = '<div>hello</div>';
doc.execCommand('SelectAll', false, null);
iframe.style.width = '50px';
iframe.style.height = '50px';
iframe.offsetLeft; // Force layout
iframe.style.width = '200%';
iframe.style.height = '200%';
return iframe.contentWindow.getSelection();
}
document.body.addEventListener('overflowchanged', function () {
document.body.innerHTML = 'This tests removing the iframe for which overflowchanged is dispatched. WebKit should not crash.';
});
prepare().collapseToStart();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment