Index: chrome/test/chromedriver/window_commands.cc |
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc |
index 8a62f896d254f1369b267d6aa464c025cc20bf4f..9a3c40512fa32d40afa8c6e46dcc08131266fa7d 100644 |
--- a/chrome/test/chromedriver/window_commands.cc |
+++ b/chrome/test/chromedriver/window_commands.cc |
@@ -470,22 +470,15 @@ Status ExecuteMouseMoveTo( |
WebPoint location; |
if (has_element) { |
- Status status = ScrollElementIntoView( |
- session, web_view, element_id, &location); |
+ WebPoint offset(x_offset, y_offset); |
+ Status status = ScrollElementIntoView(session, web_view, element_id, |
+ has_offset ? &offset : nullptr, &location); |
if (status.IsError()) |
return status; |
} else { |
location = session->mouse_position; |
- } |
- |
- if (has_offset) { |
- location.Offset(x_offset, y_offset); |
- } else { |
- WebSize size; |
- Status status = GetElementSize(session, web_view, element_id, &size); |
- if (status.IsError()) |
- return status; |
- location.Offset(size.width / 2, size.height / 2); |
+ if (has_offset) |
+ location.Offset(x_offset, y_offset); |
} |
std::list<MouseEvent> events; |