NEW 232996
rect returns wrong coordinates after calling scrollIntoView
https://bugs.webkit.org/show_bug.cgi?id=232996
Summary rect returns wrong coordinates after calling scrollIntoView
sebastian.klaar
Reported 2021-11-11 06:38:21 PST
We're using webdriverio to execute automated tests on Safari. The w3c command "scrollIntoView" causes the following command to return wrong coordinates: /session/:sessionId/element/:elementId/rect": { "GET": { "command": "getElementRect", "description": "The Get Element Rect command returns the dimensions and coordinates of the given web element.", "ref": "https://w3c.github.io/webdriver/#dfn-get-element-rect", "variables": [{ "name": "elementId", "description": "the id of an element returned in a previous call to Find Element(s)" }], "parameters": [], "returns": { "type": "Object", "name": "elementRect", "description": "A JSON object representing the position and bounding rect of the element." } } }, The returned values are off by the amount of scroll range. According to the w3c specification "rect" should return coordinates relative to the browsing context and not to the viewport.
Attachments
sebastian.klaar
Comment 1 2021-11-11 06:38:43 PST
Sam Sneddon [:gsnedders]
Comment 2 2021-11-15 04:25:40 PST
rdar://80958449 > According to the w3c specification "rect" should return coordinates relative to the browsing context No, it's "relative to the current browsing context’s document element" WPT has some failing tests, though not scrolling first: https://wpt.fyi/results/webdriver/tests/get_element_rect/get.py?label=experimental&label=master&aligned
Note You need to log in before you can comment on or make changes to this bug.