translation on root (html) element affects scrollHeight (and scrollbars / scroll position on viewport)
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
[Note: for now I'm phrasing "expected results "/"actual results" from the perspective of interop with Chrome. I don't actually know who's correct, and it's possible this will result in a chrome bug and we can close this one.]
STR:
- Load attached testcase.
- Look at the message in the alert that pops up (and the scrollbar).
ACTUAL RESULTS:
As noted in the alert, the root element's scrollHeight did change when we added a transform style to the html element.
EXPECTED RESULTS:
The root element's scrollHeight should not change (at least, that's the behavior in Chrome, and there are WPT tests that expect this behavior).
These WPT tests somewhat-indirectly depend on Chrome's behavior here:
https://wpt.fyi/results/css/css-transforms/transform-translate-background-001.html
https://wpt.fyi/results/css/css-transforms/transform-translate-background-002.html
and they're included in the WPT "compat2021" test set as listed here:
https://raw.githubusercontent.com/Ecosystem-Infra/wpt-results-analysis/main/compat-2021/css-transforms-tests.txt
Comment 1•3 years ago
|
||
If you use html.style.transform = "translate(0, 100px)"
instead (i.e. translate the content downwards instead of upwards), Chrome does let this increase the scrollHeight. So it seems a bit inconsistent that translating upwards doesn't reduce it. But I'm not sure how clear the spec is about this...
Reporter | ||
Comment 2•3 years ago
|
||
I just realized my original testcase had a code-comment that misidentified Chrome & Firefox's behavior (I had them backwards in the testcase's code-comment; not important, but confusing).
I've fixed that in this new version of the testcase, and I adjusted the text to be visible so you can actually visualize the transform.
Reporter | ||
Comment 3•3 years ago
|
||
Here's a testcase to illustrate jfkthame's observation. Both Firefox and Chrome report an increased scrollHeight on this one.
Comment 4•3 years ago
|
||
In my naive understanding, this behavior is correct; From the CSSOM View spec
If the element is the root element and document is not in quirks mode return max(viewport scrolling area height, viewport height).
Description
•