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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/5080333-1.html

Issue 1459783003: Make layout tests in editing/deleting and editing/execCommand to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
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 caret should be the same before and after t he operation.</p> 4 <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 caret should be the same before and after t he operation.</p>
2 <div id="div" contenteditable="true">foo<br><img src="../resources/abe.png"><br> baz</div> 5 <div id="div" contenteditable="true">foo<br><img src="../resources/abe.png"><br> baz</div>
6 <div id="log"></div>
7 <script>
8 test(function() {
9 var div = document.getElementById('div');
10 var selection = window.getSelection();
3 11
4 <script> 12 selection.collapse(div, 0);
5 var div = document.getElementById("div"); 13 selection.modify('move', 'forward', 'paragraphBoundary');
6 var sel = window.getSelection(); 14 selection.modify('move', 'forward', 'character');
7 15
8 sel.collapse(div, 0); 16 document.execCommand('JustifyCenter');
9 sel.modify("move", "forward", "paragraphBoundary");
10 sel.modify("move", "forward", "character");
11 17
12 document.execCommand("JustifyCenter"); 18 assert_equals(div.innerHTML, 'foo<br><div style="text-align: center;"><img s rc="../resources/abe.png"></div>baz');
19 assert_true(selection.isCollapsed);
20 assert_equals(selection.anchorNode, div.childNodes[2]);
21 assert_equals(selection.anchorOffset, 0);
22 });
13 </script> 23 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698