scroll-margin is not respected -> element.focus() is outside of the viewport
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: tuxle, Assigned: emilio)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0
Steps to reproduce:
When using element.focus()
on elements with scroll-margin
firefox does should always scroll the viewport so that the element including the scroll-margin
are inside the viewport.
Actual results:
Firefox does not scroll if the element is outside the viewport by less than the scroll-margin
resulting in elements having :focus
that are not visible.
Expected results:
Firefox should have scrolled the element in the viewport and then scrolled further by scroll-margin
if possible
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Yeah, the issue is that some of these things scroll "only if needed", but we account for scroll-margin
too early, and use the inflated rect to determine whether the thing is already visible.
Assignee | ||
Comment 3•3 years ago
|
||
So that margin is not included in the rect for visibility calculations,
and padding and margin are accounted properly on them.
I would love to test that patch.
I built a minimal example: https://data.estada.ch/firefox_scroll-margin_bug/
Can you use that as a test?
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8befa6dc66fd Fix scroll-margin implementation. r=hiro
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28856 for changes under testing/web-platform/tests
Comment 7•3 years ago
|
||
bugherder |
Tested it with nightly 90.0a1 (2021-05-06) (64-bit) and it works!
Thank you!
Upstream PR merged by moz-wptsync-bot
Description
•