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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html

Issue 2294193002: Convert editing/style/smoosh-styles-00[13].html to use w3c test harness (Closed)
Patch Set: 2016-09-02T14:10:21 Created 4 years, 3 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
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <div contenteditable>
6 <span id="sample" style="color: red;">abfg</span>
7 <div id="sample">cde</div>
8 </div>
9 <script>
10 test(() => {
11 assert_not_equals(window.internals, undefined,
12 'This test requires clipboard access from JavaScript.');
13
14 assert_selection(
15 [
16 '<div contenteditable>',
17 '<span style="color: red;">ab|fg</span>',
18 '</div>',
19 ].join(''),
20 selection => {
21 selection.setClipboardData('CDE');
22 selection.document.execCommand('paste');
23 },
24 [
25 '<div contenteditable>',
26 '<span style="color: red;">ab</span>',
27 'CDE|',
28 '<span style="color: red;">fg</span>',
29 '</div>',
30 ].join(''),
31 'Paste into middle of colored SPAN');
32
33 assert_selection(
34 [
35 '<div contenteditable>',
36 // TDOO(yosin): Once we stop normalize selection, we should get
37 // rid of "x". Until then, we need to have "x" to place caret.
38 '<div style="margin-left: 40px; text-indent: -40px;">x|</div>',
39 '</div>',
40 ].join(''),
41 selection => {
42 selection.setClipboardData('<span style="margin-left: 40px; text-ind ent: -40px;">foo</span>');
43 selection.document.execCommand('paste');
44 },
45 [
46 '<div contenteditable>',
47 '<div style="margin-left: 40px; text-indent: -40px;">xfoo|</div> ',
48 '</div>',
49 ].join(''),
50 'Keep text-indent at pasting');
51 });
52 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698