Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html

Issue 2370683002: Convert editing/pasteboard/paste-table-002.html to use w3c test harness (Closed)
Patch Set: 2016-09-26T15:49:39 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <!doctype html>
2 <head> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 test(() => {
7 assert_not_equals(window.internals, undefined,
8 'This test requires window.internals to access clipboard');
3 9
4 <style> 10 assert_selection(
5 .editing { 11 [
6 border: 2px solid red; 12 '<div contenteditable>',
7 font-size: 24px; 13 '<div>',
8 } 14 '<div>',
9 .explanation { 15 '^abcdef',
10 border: 2px solid blue; 16 '<div style="text-align: center;">',
11 padding: 12px; 17 '<table><tr><td>foo</td><td>bar</td></tr></table>',
12 font-size: 24px; 18 '</div>',
Xiaocheng 2016/09/26 09:13:36 This <div> also contains |ghijk| in the original t
yosin_UTC9 2016/09/26 10:05:15 Done.
13 margin-bottom: 24px; 19 'ghijk|',
14 } 20 '</div>',
15 .scenario { margin-bottom: 16px;} 21 '</div>',
16 .scenario:first-line { font-weight: bold; margin-bottom: 16px;} 22 '</div>',
17 .expected-results:first-line { font-weight: bold } 23 ].join(''),
18 </style> 24 selection => {
19 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 25 selection.document.execCommand('copy');
20 26 selection.document.execCommand('delete');
21 <script> 27 selection.document.execCommand('paste');
22 function log(message) { 28 },
23 var console = document.getElementById("console"); 29 [
24 var li = document.createElement("li"); 30 '<div contenteditable>',
25 var text = document.createTextNode(message); 31 'abcdef',
26 li.appendChild(text); 32 '<div style="text-align: center;">',
27 console.appendChild(li); 33 '<table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></ta ble>',
28 } 34 '</div>',
29 35 'ghijk|',
30 function editingTest() { 36 '</div>',
31 execSelectAllCommand(); 37 ].join(''));
32 copyCommand(); 38 });
33 execDeleteCommand();
34 pasteCommand();
35 }
36
37 </script> 39 </script>
38
39 <title>Editing Test</title>
40 </head>
41 <body>
42 Problem: copy/pasting some HTML including tables can give rise to a &lt;div&gt; element as the first child of the table element. This is invalid.
43 <div contenteditable id="root">
44 <div id="test" class="editing">
45 <div>
46 abcdef
47 <div style="text-align: center" >
48 <table><tr><td>foo</td><td>bar</td></tr></table>
49 ghijk
50 </div>
51 </div>
52 </div>
53 </div>
54
55 <ol id="console" />
56
57 <script>
58 runEditingTest();
59 log(root.innerHTML);
60 if (window.testRunner)
61 testRunner.dumpAsText();
62 </script>
63
64 </body>
65 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698