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

Unified Diff: LayoutTests/svg/text/resources/SelectionTestCase.js

Issue 1114093002: Fix mouse position to truncate the coordinate for mouseMoveTo(...) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Draft 2 Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/text/resources/SelectionTestCase.js
diff --git a/LayoutTests/svg/text/resources/SelectionTestCase.js b/LayoutTests/svg/text/resources/SelectionTestCase.js
index 926bc658ff69108d865843c6323e112a4df7a844..5869ecdbdb6fbf664c636587b96855855fe658a7 100644
--- a/LayoutTests/svg/text/resources/SelectionTestCase.js
+++ b/LayoutTests/svg/text/resources/SelectionTestCase.js
@@ -63,16 +63,16 @@ function selectRange(id, start, end, expectedText) {
if (window.eventSender) {
// Trigger 'partial glyph selection' code, by adjusting the end x position by half glyph width
- var xOld = endPos.x;
+ var xOldStart = startPos.x;
+ var xOldEnd = endPos.x;
endPos.x -= endExtent.width / 2 - 1;
- var absStartPos = toAbsoluteCoordinates(startPos, element);
- var absEndPos = toAbsoluteCoordinates(endPos, element);
-
// Round the points "inwards" to avoid being affected by the truncation
// taking place in eventSender.mouseMoveTo(...).
- absStartPos.x = Math.ceil(absStartPos.x);
- absEndPos.x = Math.floor(absEndPos.x);
+ startPos.x = Math.ceil(startPos.x);
+
+ var absStartPos = toAbsoluteCoordinates(startPos, element);
+ var absEndPos = toAbsoluteCoordinates(endPos, element);
// Move to selection origin and hold down mouse
eventSender.mouseMoveTo(absStartPos.x, absStartPos.y);
@@ -85,7 +85,8 @@ function selectRange(id, start, end, expectedText) {
eventSender.mouseMoveTo(absEndPos.x, absEndPos.y);
eventSender.mouseUp();
- endPos.x = xOld;
+ startPos.x = xOldStart;
+ endPos.x = xOldEnd;
}
// Mark start position using a green line
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698