summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
blob: deae85af85c049b0f653a188cc0ade2ead1d83bf (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
29
30
31
32
<!DOCTYPE html>
<html>
<head>
    <script src="../../resources/dump-as-markup.js"></script>
</head>
<body>
    <div id="editorcontainer" contenteditable="true">
        Will select from here
        <div contenteditable="false">
            over this contenteditable=false div
        </div>
        until here.
    </div>
</body>
<script>
    Markup.description('formatblock on selection with a contenteditable="false" child.');
    
    var selection = window.getSelection();
    selection.removeAllRanges();

    var container = document.getElementById('editorcontainer');
    var range = document.createRange()
    range.setStartBefore(container.firstChild);
    range.setEndAfter(container.lastChild);
    selection.addRange(range);

    document.execCommand('italic', false, "");
    document.execCommand('formatblock', false, "<h1>");

    Markup.dump(container);
</script>
</html>