Open Bug 1724459 Opened 3 years ago Updated 3 years ago

translation on root (html) element affects scrollHeight (and scrollbars / scroll position on viewport)

Categories

(Core :: Layout: Scrolling and Overflow, defect)

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Attached file testcase 1 (obsolete) —

[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:

  1. Load attached testcase.
  2. 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

See Also: → 1724471

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...

Attached file testcase 1

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.

Attachment #9235151 - Attachment is obsolete: true

Here's a testcase to illustrate jfkthame's observation. Both Firefox and Chrome report an increased scrollHeight on this one.

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).

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: