[webkit-changes] [WebKit/WebKit] b57017: IntersectionObserver intersectionRatio < 1 observed

EWS noreply at github.com
Wed Sep 7 12:35:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5701774e49ff045c17f405df13ad7d6edfd1f41
      https://github.com/WebKit/WebKit/commit/b5701774e49ff045c17f405df13ad7d6edfd1f41
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2022-09-07 (Wed, 07 Sep 2022)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/intersection-observer/intersection-ratio-with-fractional-bounds-in-iframe-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/intersection-observer/intersection-ratio-with-fractional-bounds-in-iframe.html
    A LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/intersection-ratio-with-fractional-bounds-in-iframe-content.html
    M Source/WebCore/dom/Document.cpp

  Log Message:
  -----------
  IntersectionObserver intersectionRatio < 1 observed
https://bugs.webkit.org/show_bug.cgi?id=243573
<rdar://98541023>

Reviewed by Simon Fraser.

* Source/WebCore/dom/Document.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
We call `computeClippedRectInRootContentsSpace` recursively until the renderer’s frame
 is the main frame. If we are not yet in the main frame, we use `contentsToView` to adjust
the target rect to the origin’s view scrolling position. Before this patch we were snapping
the target rect before passing it.

The patch removes the snapping, forcing the use of FloatRect overload of contentsToView
to avoid inaccurate calculation of intersection ratio when the target is not directly in the
main frame.

* LayoutTests/imported/w3c/web-platform-tests/intersection-observer/intersection-ratio-with-fractional-bounds-in-iframe-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/intersection-observer/intersection-ratio-with-fractional-bounds-in-iframe.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/intersection-ratio-with-fractional-bounds-in-iframe-content.html: Added.

Canonical link: https://commits.webkit.org/254244@main




More information about the webkit-changes mailing list