summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/deleting/merge-div-from-span-with-style.html
blob: 4ba9566fbd400564af821c4f255c145b34e67c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.NonInheritableProperties {
background-color: yellow;
text-decoration: underline;
}
</style>
</head>
<body>
<div id="test" contenteditable="true">
<div>foo</div>
<span id="spanToMerge" class="NonInheritableProperties">bar</span>
</div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description('The span style should be preserved when merging div element.\n'
+ 'The test passes if "bar" contatins the yellow background and it\'s underlined.');

var spanToMerge = document.getElementById("spanToMerge");
spanToMerge.focus();
getSelection().collapse(spanToMerge, 0);
document.execCommand("Delete");
Markup.dump(document.getElementById("test"));
</script>
</body>
</html>