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

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

Issue 2951353003: Get rid of *live granularity* behavior from selection (Closed)
Patch Set: 2017-06-23T18:30:58 Created 3 years, 5 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 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 // TODO(editing-dev): Once http://crbug.com/736253 fixed, we should use
7 // |chrome.pointerActionSequence()| instead of |eventSender|.
8 test(() => {
9 function doDoubleClickInMiddle(selection, target) {
10 const document = selection.document;
11 const clickX = target.offsetLeft + target.offsetWidth / 2;
12 const clickY = target.offsetTop + target.offsetHeight / 2;
13 eventSender.mouseMoveTo(document.offsetLeft + clickX,
14 document.offsetTop + clickY);
15 eventSender.mouseDown();
16 eventSender.mouseUp();
17 eventSender.mouseDown();
18 eventSender.mouseUp();
19 }
20
21 assert_exists(window, 'eventSender', 'This test requires eventSender.');
22
23 assert_selection(
24 '<span id="sample">xyz</span>',
25 selection => {
26 const sample = selection.document.getElementById('sample');
27 doDoubleClickInMiddle(selection, sample);
28 sample.insertBefore(new Text('abc'), sample.firstChild);
29 },
30 '<span id="sample">abc^xyz|</span>',
31 'DOM modification outside selection should not affect selection');
32 }, 'Double-click and modify text');
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698