LazyImages: Avoid double-fetching tracking pixels |
|||||||||
Issue descriptionCurrently, an image element that fetches a tracking pixel could be double fetched if it gets near the viewport before the response headers from the initial range request for the first chunk of the image finishes. This could interfere with some servers' analytics and other metrics, so this double fetching should be avoided. One way that this could be solved would be to use heuristics to detect if an image element is probably for a tracking pixel based on its attributes (e.g. if the width and height are specified and tiny), and avoid lazily loading the image.
,
Aug 31
,
Sep 25
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f179a1e185575e3baf224f2554d076076ab5e152 commit f179a1e185575e3baf224f2554d076076ab5e152 Author: rajendrant <rajendrant@chromium.org> Date: Tue Sep 25 22:06:03 2018 LazyLoad: Avoid fetching placeholder of small images with dimensions specified Tracking pixel images are small in general and would fit in the 2KB placeholder image. But it could be double fetched if it gets near the viewport, before the placeholder range response is received. One heuristic is to avoid lazyloading image elements with small dimensions (10x 10) specified in attributes. This CL implements this. Bug: 875086 Change-Id: I70149e5d57ee7e6216238d84bbdc9d24ee9114fd Reviewed-on: https://chromium-review.googlesource.com/1198562 Commit-Queue: rajendrant <rajendrant@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#594121} [modify] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/WebKit/LayoutTests/NeverFixTests [add] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/WebKit/LayoutTests/http/tests/lazyload/fixed-dimension.html [modify] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc [modify] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/blink/renderer/core/html/parser/preload_request.cc [modify] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/blink/renderer/core/html/parser/preload_request.h [modify] https://crrev.com/f179a1e185575e3baf224f2554d076076ab5e152/third_party/blink/renderer/core/loader/image_loader.cc
,
Sep 25
The above commit disables lazyload for small images with width and height attribute mentioned. This should cover the majority of tracking pixels cases. However, dimensions could be mentioned using css style (for example., style="width:1; height:1"). Its not clear if tracking pixels use this technique. Moreover, lazyload can be modified such that placeholder is not fetched for the images(small and large) with width and height specified. And the full image is loaded when the image is about to be visible. That will be a separate optimization, and not necessarily needed for fixing tracking pixels.
,
Nov 30
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/15f1a28b9751e64158c80630f39a0f72bb3c4cd1 commit 15f1a28b9751e64158c80630f39a0f72bb3c4cd1 Author: rajendrant <rajendrant@chromium.org> Date: Fri Nov 30 05:58:18 2018 LazyLoad: Avoid deferring images with dimensions in CSS inline style Some tracking pixel images could be mentioned using CSS style. Deferring such images could lead to be double fetched if it gets near the viewport. Bug: 875086 Change-Id: I3ad2da26c552b21de374539b7ad49e35c95afc11 Reviewed-on: https://chromium-review.googlesource.com/c/1352978 Commit-Queue: rajendrant <rajendrant@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#612579} [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/css/parser/css_parser.cc [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/css/parser/css_parser.h [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/css/parser/css_parser_impl.cc [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/css/parser/css_parser_impl.h [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/html/parser/preload_request.h [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/renderer/core/loader/image_loader.cc [modify] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/web_tests/NeverFixTests [add] https://crrev.com/15f1a28b9751e64158c80630f39a0f72bb3c4cd1/third_party/blink/web_tests/http/tests/lazyload/style-dimension.html
,
Nov 30
,
Dec 11
Requesting merge of c#5 to M72. The fix disables lazyloading of some images and will be needed to when lazyload feature is enabled in beta. Ths fix has been in canary and is looking good. Thanks
,
Dec 11
Pls apply appropriate OSs label.
,
Dec 11
,
Dec 12
Your change meets the bar and is auto-approved for M72. Please go ahead and merge the CL to branch 3626 manually. Please contact milestone owner if you have questions. Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7cade9de830eaee661bf8127138a7ceca03c4368 commit 7cade9de830eaee661bf8127138a7ceca03c4368 Author: rajendrant <rajendrant@chromium.org> Date: Wed Dec 12 19:06:34 2018 LazyLoad: Avoid deferring images with dimensions in CSS inline style Some tracking pixel images could be mentioned using CSS style. Deferring such images could lead to be double fetched if it gets near the viewport. Bug: 875086 Change-Id: I3ad2da26c552b21de374539b7ad49e35c95afc11 Reviewed-on: https://chromium-review.googlesource.com/c/1352978 Commit-Queue: rajendrant <rajendrant@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Original-Commit-Position: refs/heads/master@{#612579}(cherry picked from commit 15f1a28b9751e64158c80630f39a0f72bb3c4cd1) Reviewed-on: https://chromium-review.googlesource.com/c/1374407 Reviewed-by: rajendrant <rajendrant@chromium.org> Cr-Commit-Position: refs/branch-heads/3626@{#295} Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437} [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/css/parser/css_parser.cc [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/css/parser/css_parser.h [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/css/parser/css_parser_impl.cc [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/css/parser/css_parser_impl.h [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/html/parser/preload_request.h [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/renderer/core/loader/image_loader.cc [modify] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/web_tests/NeverFixTests [add] https://crrev.com/7cade9de830eaee661bf8127138a7ceca03c4368/third_party/blink/web_tests/http/tests/lazyload/style-dimension.html
,
Dec 13
,
Dec 19
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7cade9de830eaee661bf8127138a7ceca03c4368 Commit: 7cade9de830eaee661bf8127138a7ceca03c4368 Author: rajendrant@chromium.org Commiter: rajendrant@chromium.org Date: 2018-12-12 19:06:34 +0000 UTC LazyLoad: Avoid deferring images with dimensions in CSS inline style Some tracking pixel images could be mentioned using CSS style. Deferring such images could lead to be double fetched if it gets near the viewport. Bug: 875086 Change-Id: I3ad2da26c552b21de374539b7ad49e35c95afc11 Reviewed-on: https://chromium-review.googlesource.com/c/1352978 Commit-Queue: rajendrant <rajendrant@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Original-Commit-Position: refs/heads/master@{#612579}(cherry picked from commit 15f1a28b9751e64158c80630f39a0f72bb3c4cd1) Reviewed-on: https://chromium-review.googlesource.com/c/1374407 Reviewed-by: rajendrant <rajendrant@chromium.org> Cr-Commit-Position: refs/branch-heads/3626@{#295} Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437} |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by sclit...@chromium.org
, Aug 16