This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21184 - Need clarification of scroll behavior in WebElement click() method
Summary: Need clarification of scroll behavior in WebElement click() method
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Simon Stewart
QA Contact: Browser Testing and Tools WG
Depends on:
Blocks: 20860
  Show dependency treegraph
Reported: 2013-03-04 12:40 UTC by Jim Evans
Modified: 2016-05-09 09:54 UTC (History)
2 users (show)

See Also:


Description Jim Evans 2013-03-04 12:40:37 UTC
In section, the spec says click operates on the middle of the element. It further states:

"If the element is outside the viewport (according to the [CSS21] spec), the implementation should bring the element into view first. The implementation may invoke scrollIntoView on the underlying DOM Element."

It is unclear what the method should do if, after scrolling the element into view, the middle of the element (as defined in this section) is still not visible in the viewport.
Comment 1 David Burns :automatedtester 2013-03-04 13:58:48 UTC
As long as there is something of the element visible then we should try work with it, as this is what a user *could* do. I'll take this and update accordingly.
Comment 2 David Burns :automatedtester 2013-03-04 20:25:38 UTC
after speaking to Jim Evans about this, the prefered wording that we will probably use is 

midway along the x- and y-axes of the visible portion of the element after beings scrolled into the viewport if and only if the center point of the bounding client rect of the element is not within the viewport
Comment 3 David Burns :automatedtester 2014-02-25 18:15:05 UTC
iterate over the clientRects  of the element find 1st visible one, if the center is in viewport cick it, otherwise constrain to the view port size and click the centre of that
Comment 4 David Burns :automatedtester 2016-05-09 09:54:10 UTC
This section has been rewritten and I think covers what was originally asked. If it doesnt please reopen and what we are missing