blob: 07484d77980a783362e573aebf04e7d9acfbe00b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
.editing {
border: 2px solid red;
font-size: 24px;
}
.explanation {
border: 2px solid blue;
padding: 12px;
font-size: 24px;
margin-bottom: 24px;
}
.scenario { margin-bottom: 16px;}
.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
.expected-results:first-line { font-weight: bold }
</style>
<script src=../editing.js></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
if (window.internals)
internals.settings.setEditingBehavior('mac');
if (window.testRunner)
testRunner.dumpAsText();
function performCopyPaste(elementName)
{
var element = document.getElementById(elementName);
window.getSelection().collapse(element.firstChild, 0);
window.getSelection().modify('extend', 'forward', 'word');
window.getSelection().modify('extend', 'forward', 'word');
copyCommand();
window.getSelection().modify('move', 'forward', 'character');
pasteCommand();
}
function editingTest() {
Markup.dump('test', 'Markup before');
performCopyPaste("test");
performCopyPaste("test2");
performCopyPaste("test3");
Markup.dump('test', 'Markup after');
}
</script>
<title>Editing Test</title>
</head>
<body>
<div class="explanation">
<div class="scenario">
Tests:
<br>
Fix for this bug:
<a href="https://bugs.webkit.org/show_bug.cgi?id=58925">&lt;https://bugs.webkit.org/show_bug.cgi?id=58925&gt;</a> REGRESSION(r55762): Highlight color can't be copied in gmail.
</div>
<div class="expected-results">
Expected Results:
<br>
The pasted text should have the same background color as the copied text. To run the test manually, select each of the two words with the same background color, copy, move the selection at the end of the second word and paste.
</div>
</div>
<div contenteditable id="test" class="editing">
<span style="background-color: rgb(255, 0, 0);">Red background</span>
<div id="test2"><span style="background-color: green;">Green background</span></div>
<div id="test3"><span style="background-color: rgb(255, 0, 0, 0);">Transparent background</span></div>
</div>
<script>
runEditingTest();
</script>
</body>
</html>