mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
An inline element wrapping a block-level child produces zero-size line-box rects at the start and end of its getClientRects() list, e.g. [0x0@(0,0.5), 32x32@(0,0.5), 0x0@(0,32.5)]. When the element sits at a fractional y-coordinate, applying Math.floor to the zero-size rect's y (e.g. floor(0.5) = 0) produces a point outside the element, causing elementsFromPoint to miss it and isInView to return false, which results in an "element not interactable: could not be scrolled into view" error. The fix introduces dom.getFirstNonZeroRect() and uses it everywhere a rect is selected from getClientRects() to compute a centre point: - DOM.sys.mjs: getPointerInteractablePaintTree (used by isInView) - interaction.sys.mjs: webdriverClickElement and seleniumClickElement - Actions.sys.mjs: getOriginCoordinates Also see the Webdriver spec bug in https://github.com/w3c/webdriver/issues/1961 Differential Revision: https://phabricator.services.mozilla.com/D301281