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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html

Issue 2398583002: Do not de-select text across continuations (Closed)
Patch Set: Switch to non-pixel tests Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html b/third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html
new file mode 100644
index 0000000000000000000000000000000000000000..4faac962648e603444f8d9bba8e50710e2839578
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+// Mac supports the 'moveCaretToBoundary' editing behavior.
+if (window.internals)
+ internals.settings.setEditingBehavior('mac');
+
+test(() => {
+ // Test continuations across a block when not hitting the margin.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<div>BLOCK</div><p>BBBBB</p><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop + 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<div>BLOCK</div><p>BBBBB</p><p id="secondP">CC|CCC</p></font>');
+
+ // Test continuation margin.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<p>BBBBB</p><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop - 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<p>BBBBB</p><p id="secondP">|CCCCC</p></font>');
+
+ // Test continuation margin across a block.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<div>BLOCK</div><p>BBBBB</p><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop - 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<div>BLOCK</div><p>BBBBB</p><p id="secondP">|CCCCC</p></font>');
+
+ // Test continuation margin across a block.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<p>BBBBB</p><div>BLOCK</div><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop - 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<p>BBBBB</p><div>BLOCK</div><p id="secondP">|CCCCC</p></font>');
+
+ // Test continuation margin across a relative block.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<div style="position: relative; margin-top: 50px;">BLOCK</div><p>BBBBB</p><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop - 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<div style="position: relative; margin-top: 50px;">BLOCK</div><p>BBBBB</p><p id="secondP">|CCCCC</p></font>');
+
+ // Test continuation margin across a relative block.
+ assert_selection(
+ '<font color="blue" id="font">|AAAAA<p>BBBBB</p><div style="position: relative; margin-top: 50px;">BLOCK</div><p id="secondP">CCCCC</p></font>',
+ selection => {
+ var document = selection.document;
+ var font = document.getElementById('font');
+ var secondP = document.getElementById('secondP');
+
+ eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, document.offsetTop + font.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 20, document.offsetTop + secondP.offsetTop - 5);
+ eventSender.mouseUp();
+ },
+ '<font color="blue" id="font">^AAAAA<p>BBBBB</p><div style="position: relative; margin-top: 50px;">BLOCK</div><p id="secondP">|CCCCC</p></font>');
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698