Skip to content

Stop assuming that the scroll range for the viewport starts at 0 #50242

Done

Description

@Loirooriol

Scroll ranges can extend into negative values, see #49891

<!DOCTYPE html>
<style>
:root { direction: rtl; }
body { width: 200vw; border: solid; }
</style>
text
<script>
document.documentElement.scrollLeft = -document.documentElement.scrollWidth;
</script>

Actual: It's scrolled to the right (you see "text"). If you press the left arrow you can't scroll left, but you can sroll further right with the right arrow.

Expected: It's scrolled to the left.

Firefox is right.

Blink and WebKit refuse JS to scroll into a negative coordinate, but allow the user to scroll left, which is then reported as a negative coordinate.

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. added
    C-has-manual-testcase
    A-layout/2020
    on Nov 25, 2026
  3. added a commit that references this issue on Nov 26, 2026
    b07e50d
  4. added a commit that references this issue on Nov 28, 2026
    c65653b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-layout/2020C-has-manual-testcase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions