w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
681 stars 195 forks source link

Get Element Rect remote end steps don't match non-normative comment #1533

Open burg opened 4 years ago

burg commented 4 years ago

In chapter 12. Elements, section 12.3 State:

Calculate the absolute position of element and let it be coordinates.

I received a bug report that safaridriver's Get Element Rect command should be returning iframe-relative coordinates. So I went to look at the spec, and the Note does suggest this:

"y - Y axis position of the top-left corner of the web element relative to the current browsing context’s document element in CSS pixels."

However, the remote end steps compute (x, y) using 'calculate the absolute position' substep, which takes into account the scroll position of the top-level browsing context. Consulting non-local browsing context state seems contrary to the non-normative description.

burg commented 4 years ago

WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=213139

foolip commented 4 years ago

@burg do you know if there are tests for this that reveal what geckodriver and chromedriver do?

whimboo commented 4 years ago

@foolip, in Marionette we use the currently selected browsing context to determine the x and y values. Actually I cannot see any wdspec tests beside the very basic ones, that verify any of these values.