• Luna Lu's avatar
    Update max-image policy · f8f15ef8
    Luna Lu authored
    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/1240497Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
    Commit-Queue: Luna Lu <loonybear@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#593665}
    f8f15ef8
feature-policy-max-downscaling-image-responsive-image-expected.html 172 Bytes