New issue
Advanced search Search tips

Issue 674999 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

MHTML: Srcset processing breaks layout of some pages.

Project Member Reported by dewittj@chromium.org, Dec 16 2016

Issue description

E.g.

http://xkcd.com/1138/ vs attached mhtml file.

Looks like we download the 2x file only and leave the srcset out, but then the image size is incorrectly retained.

Possible workaround is to specify height and width attributes on image tags with srcset to retain the original size of the image.
 
example.mhtml.tar.gz
191 KB Download
Owner: jianli@chromium.org
Status: Assigned (was: Untriaged)
Jian, please consider this as MHTML sanitization feature. fgorski@ can provide details on srcset treatment.
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a908d62ac9640cc8e9e54521c8ab8133919ef24a

commit a908d62ac9640cc8e9e54521c8ab8133919ef24a
Author: jianli <jianli@chromium.org>
Date: Wed Jan 11 23:48:18 2017

Set width and height attributes for <img> if image is loaded from srcset

For device with high DPR, the image could be loaded from srcset. When
the img element is serialized, srcset attribute is skipped. We need to
set width and height attributes to retain the original size of the
image.

BUG= 674999 
TEST=new tests added

Review-Url: https://codereview.chromium.org/2624953002
Cr-Commit-Position: refs/heads/master@{#443058}

[modify] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/core/html/HTMLImageElement.h
[modify] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/WebFrameSerializer.cpp
[modify] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp
[add] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/tests/data/frameserialization/1x.png
[add] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/tests/data/frameserialization/2x.png
[modify] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/tests/data/frameserialization/hidden_elements.html
[add] https://crrev.com/a908d62ac9640cc8e9e54521c8ab8133919ef24a/third_party/WebKit/Source/web/tests/data/frameserialization/img_srcset.html

Comment 4 by jianli@chromium.org, Jan 12 2017

Status: Fixed (was: Assigned)

Sign in to add a comment