Description
from the spec:
An element is relevant to the user if any of the following conditions are true:
The element is "on-screen": its paint containment box's overflow clip edge intersects with the viewport, or a user-agent defined margin around the viewport.
Note: This margin is meant to allow the user agent to begin preparing for an element to be in the viewport soon. A margin of 50% is suggested as a reasonable default.
Technically, the "or a ua defined margin" part of this gives enough flexibility for the ua to extend the relevant area in whatever way it wants, including smart ones, but this phrasing, especially when accompanied with the note, suggests that we're talking about a fixed-size margin rather than something that may depend on content.
However, as discussed in #6325, non-local filter effects on the ancestors of the element with paint containment can cause the ua to need to render off screen paint contained elements, in order to get the filter right.
It seems that the notion of "relevant to the user" should account for that as well.
- The element is "on-screen": its paint containment box's overflow clip edge intersects with the viewport, or a user-agent defined margin around the viewport, or is close enough to the viewport that rendering it is necessary to calculate filter effects correctly.
A sufficient UA margin around the viewport is likely to make the effect of any filter barely noticeable, so maybe we don't actually need to bother, but if we're aiming for strict correctness, I think we need to take this into account.