IntersectionObserver use-cases in Media should use common machinery |
|
Issue descriptionRight now, there are two cases in the Blink C++ that use IntersectionObserver, but don't register via the same mechanisms as script. 1. HTMLMediaElement https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/media/html_media_element.cc?l=4269 2. MediaCustomControlsFullscreenDetector https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/media/media_custom_controls_fullscreen_detector.cc?l=141 This has two problems: 1. The call to ComputeGeometry happens at the wrong time. Instead of happening right after paint during the rendering lifecycle, it happens whenever the event happens to run in the event loop 2. Extra tasks being inserted into the event loop It may be that these call sites do this on purpose because they want a lower update rate than regular script uses of IntersectionObserver. In both cases they only run a measurement once a second. https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/media/html_media_element.cc?l=134 https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/media/media_custom_controls_fullscreen_detector.cc?l=19 This seems to point to a hole in the IntersectionObserver script API, as developers probably want the ability to throttle work for performance. Also filed: https://github.com/w3c/IntersectionObserver/issues/298 |
|
►
Sign in to add a comment |
|
Comment 1 by mlamouri@chromium.org
, May 11 2018