New issue
Advanced search Search tips

Issue 841835 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

IntersectionObserver use-cases in Media should use common machinery

Project Member Reported by chrishtr@chromium.org, May 10 2018

Issue description

Right 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
 
Cc: mlamouri@chromium.org

Sign in to add a comment