Skip to content

Clarify root rect with overflow and padding. #504

@emilio

Description

@emilio

https://w3c.github.io/IntersectionObserver/#intersectionobserver-root-intersection-rectangle says to use the "content area" when the element has scrollable overflow, however this seems wrong when there's padding.

Consider this test-case: https://codepen.io/jelmerdemaat/pen/wvjLMRN

  • WebKit and Blink implement the spec to the letter.
  • Firefox implements what I think is better behavior: The intersection root rect is the scrollport rect, not the content rect.

Unless I'm missing something, the intent of the spec is to not include the scrollbar and borders, but I believe the correct behavior is Firefox's.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1796268

@miketaylr @szager-chromium do you agree?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions