Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/execCommand/format_block/format-block-at-host-selected.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/format_block/format-block-at-host-selected.html b/third_party/WebKit/LayoutTests/editing/execCommand/format_block/format-block-at-host-selected.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34125def715ed894165e69ffd5f8416d3c79da1e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/execCommand/format_block/format-block-at-host-selected.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<style> |
| +div:not(#ce) { |
| + display: inline-block; |
| +} |
| +.ico::before { |
| + content: "a"; |
| +} |
| +</style> |
| + |
| +<div> |
| + <div class="ico"> |
| + </div><!-- |
| + If you remove this comment and keep the 2 div.ico on separate lines, the selection works |
| + fine, but their spacing is off since they are inline-block divs |
| + --><div class="ico"> |
| + </div> |
| +</div> |
| +<div id="ce" contenteditable="true"> |
| + This text should be selected after the test ran. |
| +</div> |
| + |
| +<script> |
| +test(function () { |
|
yosin_UTC9
2016/11/30 01:48:40
Could you use |assert_selection()| for easier to r
|
| + let range = document.createRange(); |
| + range.selectNodeContents(ce); |
| + window.getSelection().addRange(range); |
| + document.execCommand('FormatBlock', false, 'h1'); |
| + let selectionAfterFormatBlock = window.getSelection().getRangeAt(0); |
| + assert_false(selectionAfterFormatBlock.collapsed, 'The selection should not be collapsed'); |
| +}, 'The selection must remain after execCommand("FormatBlock")'); |
| +</script> |