Skip to content

Element.getBoundingClientRect() and Element.getClientRects() do not take scrolling into account. #9651

Closed

Description

@peterjoel

Activity

  1. added
    A-content/dom
    on Feb 15, 2016
  2. jdm commented on Feb 15, 2016

    @jdm
    Member

    @peterjoel Can you link to the part of the specification that suggests that they should?

  3. peterjoel commented on Feb 15, 2016

    @peterjoel
    ContributorAuthor

    I was just going by the behaviour in Safari, Firefox and Chrome. The spec isn't incredibly clear, but it says:

    Apply the transforms that apply to the element and its ancestors.

    If you follow the link on "transforms" and keep following the linked documents to this, you find:

    current transformation matrix (CTM)
    A matrix that defines the mapping from the local coordinate system into the viewport coordinate system.

    Which seems to suggest that the transformations are relative to the viewport, not the document.

  4. mrobinson commented on Sep 19, 2025

    @mrobinson
    Member

    This was fixed by #37871, I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/dom

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions