scroll-margin is not respected when typing into an offscreen textarea
Categories
(Core :: Layout: Scrolling and Overflow, defect, P3)
Tracking
()
People
(Reporter: sammy, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
- Open the attached file (bug-test.html)
- Scroll to the bottom of the page
- Click the scrollIntoView() button, note that the fixed div is not obscuring the textarea
- Click on the textarea to focus it
- Scroll to the bottom of the page so that the textarea is offscreen
- Type any text to autoscroll the viewport
Actual results:
After hitting the scrollIntoView button, the viewport scrolled up far enough that the fixed div did not obscure the textarea. After typing into the textarea, the viewport did not auto-scroll far enough, and the fixed div covered up the typing area.
Expected results:
The viewport should have auto-scrolled far enough that there was (scroll-margin-top) worth of space above the typing area.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Seems like bug 1534070 landed with (the equivalent to) this line.
Hiro, seems there are a bunch of callers that use that flag. Is there really any case where we want not to honor scroll-margin and scroll-padding?
I think we should ~always honor them.
Comment 2•6 years ago
|
||
Basically what I did for scroll-{margin,padding} was to ignore them for internal usages (i.e. not web-exposed features). But yeah in this case we should honor them. And it is/was not clear to me whether all the places should honor them or not. So to me, a way I can think of is bug-report-driven just like this bug. And IIRC, Masayuki gave me a comment that he is reluctant to honor them in all places blindly (and I agreed with him).
Updated•6 years ago
|
Updated•4 years ago
|
Comment 3•8 months ago
•
|
||
Chrome matches our behavior, FWIW.
Safari gives results that happen to look nicer for this testcase -- they scroll all the way back to the top (so that there's some blue visible between the textarea and the transparent div -- but they do that regardless of scroll-margin-top.
Comment 4•7 months ago
|
||
Here's a modified testcase that I used to prod at the Safari/WebKit behavior that I mentioned in comment 3.
This illustrates that, when you start typing into a line of text in the textarea:
(A) if the line that you're typing is party offscreen, then Safari scrolls enough to move that line into the viewport. [This matches Chrome/Firefox.]
(B) if the line that you're typing into is entirely offscreen, then Safari scrolls to center the line in the viewport (as best as it can -- e.g. in the original testcase, it can't actually center the line because it runs up against the top of the page and can't scroll any more) [This is different from Chrome/Firefox -- Chrome/Firefox only scroll far enough to move the line into the viewport, as in (A).]
(C) Safari doesn't take scroll-margin into account for this process at all. [This matches Chrome/Firefox.]
So: bottom line, the request in this bug (to respect scroll-margin) seems reasonable, but it's worth noting that no browser currently has the requested behavior.
Description
•