nytimes crossword scrolls off screen when typing (focus() on SVG element scrolls if its <svg> is partly off-screen)
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
People
(Reporter: bobmetarts, Assigned: tnikkel)
References
(Regression, )
Details
(Keywords: regression)
Attachments
(4 files, 1 external file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0
Steps to reproduce
In the last week, while doing the New York Times crossword, whenever I try to fill in a square at the bottom of the puzzle (the last 4 or 5 rows), the whole screen jumps to the top and I have to scroll back down again to fill in the square. This is incredibly annoying. And it only happens in Firefox. Other browsers do not have this problem. This is obviously a bug in Version 159.
Actual results
Instead of letting me fill in the square, the whole screen jumped to the top.
Expected results
Nothing should have happened.
Comment 1•10 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox for Android::General' component, but is not confident enough to move the bug to that component.
The Bugbug bot is WRONG! This bug is on my Win 11 desktop version of Firefox, not on my android phone.
Comment 3•8 days ago
•
|
||
Thank you for reporting this, Bob!
I was able to reproduce the jumping behavior in Firefox 160 on Linux in the NYT Crossword puzzle, but not in Chrome.
Here is a minimal example:
<!doctype html>
<meta charset="utf-8">
<title>focus() on a visible SVG element scrolls when its <svg> is partly off screen</title>
<!--
Minimal test case (bug 2091995). The gold square, an SVG <g tabindex=0>, is fully visible; only the top 20px of its
<svg> are above the viewport. Calling focus() should not scroll.
Expected (Chrome 157): "ok". Actual (Firefox 160): the page jumps up.
-->
<p id="out" style="position:fixed;top:0;left:0;right:0;margin:0;padding:6px;background:#ffd;font:14px monospace">running…</p>
<div style="height:1000px"></div>
<svg width="200" height="400" style="display:block">
<rect width="200" height="400" fill="#ddd"/>
<g id="target" tabindex="0"><rect y="340" width="60" height="60" fill="gold"/></g>
</svg>
<div style="height:2000px"></div>
<script>
history.scrollRestoration = "manual";
onload = () => setTimeout(() => {
const svg = document.querySelector("svg"), target = document.getElementById("target");
scrollTo(0, svg.getBoundingClientRect().top + scrollY + 20); // svg top edge 20px above the viewport
const before = scrollY, top = target.getBoundingClientRect().top;
target.focus();
document.getElementById("out").textContent =
`${Math.abs(scrollY - before) > 1 ? "BUG: page scrolled" : "ok: no scroll"} - scrollY ${Math.round(before)} -> ${Math.round(scrollY)}` +
` (target was at ${Math.round(top)}px of a ${innerHeight}px viewport) | ${navigator.userAgent}`;
}, 0);
</script>
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:160.0) Gecko/20100101 Firefox/160.0
Updated•8 days ago
|
Updated•8 days ago
|
| Assignee | ||
Updated•8 days ago
|
| Assignee | ||
Updated•8 days ago
|
| Assignee | ||
Updated•8 days ago
|
| Assignee | ||
Comment 5•8 days ago
|
||
Another testcase.
| Assignee | ||
Comment 6•8 days ago
|
||
I was able to reproduce but I was also able to reproduce in a build from a year, so seems like it's been around for a while. I think bug 1842679 is what regressed this.
Comment 7•8 days ago
|
||
Set release status flags based on info from the regressing bug 1842679
| Assignee | ||
Comment 8•8 days ago
|
||
SVG container frames like <g> don't set mRect, so scrolling one into view
(including focus()) used an empty rect at the origin of the outer <svg>. If
that point wasn't visible we would scroll even though the element itself was
fully visible. Use the same bounds getBoundingClientRect uses.
| Reporter | ||
Comment 10•8 days ago
|
||
I'm only the reporter of the bug and know nothing about how to fix the problem. But I just want to point out that in the last hour I can no longer access ANY of the New York Times games pages -- either in Firefox OR in Explorer. They are all marked: "This page no longer exists."
See the attached screenshot.
| Reporter | ||
Comment 11•8 days ago
|
||
Updated•8 days ago
|
Comment 12•7 days ago
|
||
| bugherder | ||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/65235 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Comment 15•5 days ago
|
||
:tnikkel did you want to nominate this for the Fx162 relnotes? If so, set the relnote-firefox flag to "?"
Possible wording:
Fixed the page jumping out of view while typing on some sites, such as the New York Times crossword.
| Assignee | ||
Comment 16•5 days ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: prominent site nytimes crossword
[Affects Firefox for Android]: theoretically, but nytimes crossword didn't hit this on android
[Suggested wording]: Fixed the page jumping out of view while typing on some sites, such as the New York Times crossword.
[Links (documentation, blog post, etc)]: none
Updated•5 days ago
|
Description
•