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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/focus_editable_html_element.html

Issue 1806423003: Convert editing/selection layout tests to use w3c test harness, volume 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 <html contenteditable>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <body>
6 This tests to see where the selection is set when an html element is focused.
7 <br>
8 We set it inside the body because we don't want to allow editing outside the
9 body.
10 <div id="log"></div>
11 </body>
12 </html>
13 <script>
14 var test = async_test('focus to editable should not scroll');
15 document.documentElement.addEventListener('focus', function() {
16 var selection = window.getSelection();
17 var anchor = document.body.firstChild;
18 assert_equals(selection.anchorNode, anchor, 'anchorNode');
19 assert_equals(selection.anchorOffset, 1, 'anchorOffset');
20 assert_equals(selection.focusNode, anchor, 'focusNode');
21 assert_equals(selection.focusOffset, 1, 'focusOffset');
22
23 test.done();
24 });
25 test.step(function() {
26 document.documentElement.focus();
27 });
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698