max-downscaling-image: image's size is wrong |
||||
Issue descriptionCurrently the policy uses a image element's naturalWidth/naturalHeight as the image's size, but this is incorrect for cases: 1. intrinsicSize attribute overrides naturalWidth/naturalHeight; 2. srcset w descriptor sizes will determine naturalWidth/naturalHeight; So, instead, we should be using the actual size of the Image object.
,
Sep 24
,
Sep 24
,
Sep 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f8f15ef8456e7ff007735b5941f67cb12bfa463a commit f8f15ef8456e7ff007735b5941f67cb12bfa463a Author: Luna Lu <loonybear@chromium.org> Date: Mon Sep 24 20:36:40 2018 Update max-image policy Currently the policy uses a image element's naturalWidth/naturalHeight as the image's size, but this is incorrect for cases: 1. intrinsicSize attribute overrides naturalWidth/naturalHeight; 2. srcset w descriptor sizes will determine naturalWidth/naturalHeight; So, instead, we should be using the actual size of the Image object. Bug: 888578 Change-Id: I2abc9854ffd8c0d942651085d510885a82884ad8 Reviewed-on: https://chromium-review.googlesource.com/1240497 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: Luna Lu <loonybear@chromium.org> Cr-Commit-Position: refs/heads/master@{#593665} [add] https://crrev.com/f8f15ef8456e7ff007735b5941f67cb12bfa463a/third_party/WebKit/LayoutTests/images/feature-policy-max-downscaling-image-responsive-image-expected.html [add] https://crrev.com/f8f15ef8456e7ff007735b5941f67cb12bfa463a/third_party/WebKit/LayoutTests/images/feature-policy-max-downscaling-image-responsive-image.html [add] https://crrev.com/f8f15ef8456e7ff007735b5941f67cb12bfa463a/third_party/WebKit/LayoutTests/images/resources/frame-with-max-downscaling-image-responsive-images-expected.html [add] https://crrev.com/f8f15ef8456e7ff007735b5941f67cb12bfa463a/third_party/WebKit/LayoutTests/images/resources/frame-with-max-downscaling-image-responsive-images.html [modify] https://crrev.com/f8f15ef8456e7ff007735b5941f67cb12bfa463a/third_party/blink/renderer/core/layout/layout_image.cc
,
Sep 24
|
||||
►
Sign in to add a comment |
||||
Comment 1 by loonyb...@chromium.org
, Sep 24