IntersectionObserver IntersectionRect and BoundingClientRect Inconsistent |
|||
Issue descriptionChrome Version: 60.0.3112.101 OS: Linux What steps will reproduce the problem? (1) Go onto https://diply.com/redonkulous-tattoos/5?publisher=bert (2) Create an Intersection Observer: new IntersectionObserver((entries) => {console.log("entries", entries);}) (3) Observe the div with ID "div-da-content1" (4) Look at the dimensions for IntersectionRect and BoundingClientRect in the entry. There is an off by one error. See https://groups.google.com/a/google.com/forum/#!topic/ads-latency-infra/vj8-Xl5xOUs What is the expected result? The top, right, bottom and left values should be the same for IntersectionRect and BoundingClientRect since the div is fully onscreen. What happens instead? The IntersectionRect top is 289, while the BoundingClientRect top is 290 (at least those are the dimensions for my screensize). Note I've only been able to reproduce this on my workstation, not my laptop (OSX). Please use labels and text to provide additional information. For graphics-related bugs, please copy/paste the contents of the about:gpu page at the end of this report.
,
Nov 1 2017
,
Nov 1 2017
,
Mar 12 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb commit f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb Author: Stefan Zager <szager@chromium.org> Date: Mon Mar 12 19:01:15 2018 [IntersectionObserver] Don't snap bounding rects These rects should mirror the behavior of getBoundingClientRect, which doesn't snap. BUG=758587,737228 Change-Id: If735df6bd24414dfbbd58dce01dc2a90f71df381 Reviewed-on: https://chromium-review.googlesource.com/951640 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#542548} [modify] https://crrev.com/f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html [modify] https://crrev.com/f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb/third_party/WebKit/Source/core/intersection_observer/IntersectionObservation.cpp [modify] https://crrev.com/f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverEntry.cpp [modify] https://crrev.com/f8bf3f03dd8f4b81cb36d21c8af07844de4e9ecb/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverEntry.h |
|||
►
Sign in to add a comment |
|||
Comment 1 by szager@google.com
, Sep 29 2017