blob: 61e1347a464d1dbc579461034f05ecb781af6f21 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../resources/dump-as-markup.js"></script>
</head>
<body>
<div contenteditable="true" id="test">
abc<div style="position: fixed; left: 0px; top: 0px;">def</div>ghi
</div>
<script>
Markup.description('This tests to see if position:sticky and position:fixed don\'t get converted to position:static and position:absolute upon copy/paste when there is only a partial selection (not the entire body is selected)');
if (window.internals)
window.internals.settings.setShouldConvertPositionStyleOnCopy(true);
var e = document.getElementById("test");
var s = window.getSelection();
Markup.dump('test', 'Before');
s.setPosition(e, 0);
document.execCommand("SelectAll");
document.execCommand("Cut");
document.execCommand("Paste");
Markup.dump('test', 'After');
</script>
</body>
</html>