Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / insert-paragraph-separator-in-blockquote.html
blobe2bd108e99ff11984b1416fc6c5121bee3da44f2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 .editing {
6 border: 2px solid red;
7 padding: 12px;
9 blockquote {
10 border-left: 2px solid blue;
11 padding: 1em;
12 margin: 0;
14 </style>
16 </head>
17 <body>
18 <div contenteditable id="topDiv" class="editing">
19 <blockquote id="testBQ" style="color:blue;"><div id="testDiv">First Line</div><div>Second Line</div></blockquote>
20 </div>
21 <script src="../../resources/dump-as-markup.js"></script>
22 <script>
23 function pressKey(key)
25 if (window.KeyEvent) {
26 var kbEvent = document.createEvent("KeyboardEvent");
27 kbEvent.initKeyEvent("keypress", true, true, window, 0,0,0,0, 0, key.charCodeAt(0));
28 document.body.dispatchEvent(kbEvent);
29 } else {
30 var kbEvent = document.createEvent("TextEvent");
31 kbEvent.initTextEvent('textInput', true, true, null, key.charAt(0));
32 document.body.dispatchEvent(kbEvent);
36 if (window.testRunner)
37 testRunner.dumpAsText();
39 var topDiv = document.getElementById("topDiv");
40 var nodesOfTopDiv = topDiv.childNodes.length;
41 var blockquoteElement = document.getElementById("testBQ");
42 var nodesOfBlockquote = blockquoteElement.childNodes.length;
43 var insertionDiv = document.getElementById("testDiv").firstChild;
44 var selection = window.getSelection();
45 selection.collapse(insertionDiv, insertionDiv.textContent.length);
47 document.execCommand('InsertParagraph', false, null);
49 Markup.description('This test ensures the paragraph separator inserted between quoted lines inside the blockquote.\n'
50 + 'You should see a <br> tag between \'First Line\' and \'Second Line\'.\n');
51 Markup.dump('testBQ');
52 </script>
53 </body>
54 </html>