Skip to content

What should document.scrollingElement.clientWidth return? #8

Description

@theres-waldo

On a page where the fixed viewport is larger than the ICB, what should document.scrollingElement.clientWidth return?

My experimentation seems to show that in Chrome it currently returns the ICB width.

  • Is this observation correct?

  • If so, is this the desired behaviour?

The spec says it should return "the viewport width excluding the size of a rendered scroll bar (if any)". Obviously, "viewport" in existing specs is ambiguous, but seeing as it's talking about scroll bars, I would think that, considering the implementation model described here, we'd want to use the scroll port width of one of the two scrollers, and the ICB width is neither.

I did look at this spreadsheet (linked from this section of the explainer doc) which lists the various APIs, but it's not clear to me whether it's up to date, as it talks about the "layout viewport" and not the "fixed viewport".

The explainer doc itself says that Chrome has moved to an "all fixed" model, which makes the current behaviour seem suprising.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions