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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/editing/selection/double_click_and_modify.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/double_click_and_modify.html b/third_party/WebKit/LayoutTests/editing/selection/double_click_and_modify.html
new file mode 100644
index 0000000000000000000000000000000000000000..cc737d09b2c529600d8c4a72e385714b008a9255
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/double_click_and_modify.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+// TODO(editing-dev): Once http://crbug.com/736253 fixed, we should use
+// |chrome.pointerActionSequence()| instead of |eventSender|.
+test(() => {
+ function doDoubleClickInMiddle(selection, target) {
+ const document = selection.document;
+ const clickX = target.offsetLeft + target.offsetWidth / 2;
+ const clickY = target.offsetTop + target.offsetHeight / 2;
+ eventSender.mouseMoveTo(document.offsetLeft + clickX,
+ document.offsetTop + clickY);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+
+ assert_exists(window, 'eventSender', 'This test requires eventSender.');
+
+ assert_selection(
+ '<span id="sample">xyz</span>',
+ selection => {
+ const sample = selection.document.getElementById('sample');
+ doDoubleClickInMiddle(selection, sample);
+ sample.insertBefore(new Text('abc'), sample.firstChild);
+ },
+ '<span id="sample">abc^xyz|</span>',
+ 'DOM modification outside selection should not affect selection');
+}, 'Double-click and modify text');
+</script>

Powered by Google App Engine
This is Rietveld 408576698