Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html b/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..47ff488a04122b5777bb369e83140d98abf34714 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/style/smoosh_styles.html |
| @@ -0,0 +1,48 @@ |
| +<!doctype html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../assert_selection.js"></script> |
| +<script> |
| + test(() => assert_selection( |
| + [ |
| + '<div contenteditable>', |
| + '<div><span style="color: red;">abfg</span></div>', |
| + '<div>^cde|</div>', |
| + '</div>', |
| + ].join(''), |
| + selection => { |
| + assert_not_equals(window.testRunner, undefined, |
| + 'This test requires testRunner'); |
| + selection.document.execCommand('cut'); |
| + selection.document.execCommand('delete'); |
| + selection.modify('move', 'backward', 'line'); |
| + selection.modify('move', 'forward', 'character'); |
| + selection.modify('move', 'forward', 'character'); |
|
yoichio
2016/08/31 08:20:25
Could you use collapse()?
yosin_UTC9
2016/08/31 09:58:40
Done.
|
| + selection.document.execCommand('paste'); |
| + }, |
| + [ |
| + '<div contenteditable>', |
| + '<div><span style="color: red;">ab</span>cde|<span style="color: red;">fg</span></div>', |
| + '</div>', |
| + ].join('')), |
| + 'Paste into middle of colored SPAN'); |
| + |
| + test(() => assert_selection( |
| + [ |
| + '<div contenteditable>', |
| + '<div style="margin-left: 40px; text-indent: -40px;">^foo|</div>', |
| + '</div>', |
| + ].join(''), |
| + selection => { |
| + assert_not_equals(window.testRunner, undefined, |
| + 'This test requires testRunner'); |
| + selection.document.execCommand('cut'); |
| + selection.document.execCommand('paste'); |
| + }, |
| + [ |
| + '<div contenteditable>', |
| + '<div style="margin-left: 40px; text-indent: -40px;">foo|</div>', |
| + '</div>', |
| + ].join('')), |
| + 'Keep text-indent at pasting'); |
| +</script> |