Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / execCommand / 5080333-2.html
1 <p>This tests for a bug where changing the alignment of an image would result in a selection that wasn't the one that was present before the alignment change.  The image should be centered and the selection should be the same before and after the operation.</p>
2 <div id="div" contenteditable="true">foo<br><img src="../resources/abe.png"><br>baz</div>
3
4 <script>
5 var div = document.getElementById("div");
6 var sel = window.getSelection();
7
8 sel.collapse(div, 0);
9 sel.modify("move", "forward", "paragraphBoundary");
10 sel.modify("move", "forward", "character");
11 sel.modify("extend", "forward", "character");
12
13 document.execCommand("JustifyCenter");
14 </script>