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

Issue 848483002: [chromedriver] Use center of first ClientRect when moving mouse to an element. (Closed)

Created:
5 years, 11 months ago by samuong
Modified:
5 years, 11 months ago
Reviewers:
stgao
CC:
chromium-reviews, samuong+watch_chromium.org, stgao, seva
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[chromedriver] Use center of first ClientRect when moving mouse to an element. Previously we used the center of the bounding box, but this can cause problems if the center of the bounding box is outside the element. This CL also changes the behavior of the GetElementLocationOnceScrolledIntoView command in the same way. BUG= Committed: https://crrev.com/089c3ddeec583fd9e11564727a9695b70657e681 Cr-Commit-Position: refs/heads/master@{#311423}

Patch Set 1 #

Patch Set 2 : Use region size from getElementRegion(), rather than calling getClientRects() again #

Patch Set 3 : add some extra checks to testMoveToElementAndClick #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -17 lines) Patch
M chrome/test/chromedriver/element_commands.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/chromedriver/element_util.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/chromedriver/element_util.cc View 1 1 chunk +11 lines, -4 lines 4 comments Download
M chrome/test/chromedriver/test/run_py_tests.py View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
M chrome/test/chromedriver/window_commands.cc View 1 1 chunk +5 lines, -12 lines 0 comments Download
A chrome/test/data/chromedriver/multiline.html View 1 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
samuong
5 years, 11 months ago (2015-01-12 04:22:14 UTC) #2
chromium-reviews
Thanks Sam! Two things: 1) didn't we want to move to the center (of the ...
5 years, 11 months ago (2015-01-12 22:11:10 UTC) #3
stgao
Overall, the code lgtm. It is good to support those corner cases. https://codereview.chromium.org/848483002/diff/40001/chrome/test/chromedriver/element_util.cc File chrome/test/chromedriver/element_util.cc ...
5 years, 11 months ago (2015-01-14 01:47:20 UTC) #4
samuong
Seva, for 1) we'll be adding the offsets if there are any (see element_util.cc:591) and ...
5 years, 11 months ago (2015-01-14 04:35:05 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/848483002/40001
5 years, 11 months ago (2015-01-14 05:38:59 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 11 months ago (2015-01-14 07:04:24 UTC) #8
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/089c3ddeec583fd9e11564727a9695b70657e681 Cr-Commit-Position: refs/heads/master@{#311423}
5 years, 11 months ago (2015-01-14 07:05:26 UTC) #9
chromium-reviews
5 years, 11 months ago (2015-01-14 09:08:20 UTC) #10
Message was sent while issue was closed.
Ah, I guess you got it right with/without offsets. I didn't read your
change carefully enough before, somehow.. So it sounds reasonable.

I am now thinking about two edge cases:
1. Element is much lager than browser's viewport. In that case if we are
trying to scroll the center of the element (or its first clientrect) into
view, we may want to pass true /* center */ to the
ScrollElementRegionIntoView atom, and not false /* center */.

2. What if the offset (x,y) that user passed has one or both negative
coordinates? Say (-1, -1). Don't we want to scroll into view the
(elementTop-1, elementLeft-1) point of the page? (or, as usual, as close to
that point as possible)

On Tue, Jan 13, 2015 at 8:35 PM, <samuong@chromium.org> wrote:

> Seva, for 1) we'll be adding the offsets if there are any (see
> element_util.cc:591) and using the center of the first ClientRect if there
> isn't
> (see element_util.cc:593). For 2) I might've been wrong about the behavior
> of
> FirefoxDriver so I've removed this from the description. I think I misread
> your
> comment from your other bug report...
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698