New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 888578 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 24
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

max-downscaling-image: image's size is wrong

Project Member Reported by loonyb...@chromium.org, Sep 24

Issue description

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.
 
Description: Show this description
Description: Show this description
Status: Started (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)

Sign in to add a comment