From 440fde89f6d0643ecddd67c97e55b08b968b3fd5 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Thu, 22 Oct 2020 11:57:38 +0200 Subject: [PATCH] Suggest a rootMargin strategy for lazy-loaded elements See https://github.com/whatwg/html/issues/5408#issuecomment-623683336 Fixes #5408. --- source | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/source b/source index 7ace189e0f1..6cfa119d08e 100644 --- a/source +++ b/source @@ -6980,14 +6980,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The options is an IntersectionObserverInit dictionary with the - following dictionary members: «[ "rootMargin" → an - implementation-defined value ]»

    - -

    See issue #5408.

    + following dictionary members: «[ "rootMargin" → lazy load root + margin

    This allows for fetching the image during scrolling, when it does not yet — but is about to — intersect the viewport.

    + +

    The lazy load root margin suggestions imply dynamic changes to the + value, but the IntersectionObserver API does not support changing the root + margin. See issue w3c/IntersectionObserver#428.

  • @@ -7025,6 +7027,30 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute +

    + + The lazy load root margin is an implementation-defined value, but with + the following suggestions to consider:

    + + + +

    It is important for + privacy that the lazy load root margin not leak additional information. For + example, the typical scrolling speed on the current device could be imprecise so as to not + introduce a new fingerprinting vector.

    Common DOM interfaces