Bug 159367 - Null cached image for certain uses of -webkit-image-set
Summary: Null cached image for certain uses of -webkit-image-set
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-01 13:31 PDT by Brent Fulgham
Modified: 2016-07-05 08:43 PDT (History)
5 users (show)

See Also:


Attachments
Test case showing the null image (6.14 KB, application/zip)
2016-07-01 13:31 PDT, Brent Fulgham
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2016-07-01 13:31:37 PDT
Created attachment 282572 [details]
Test case showing the null image

Certain web content results in the 'cachedImage' member of the HTMLImageElement's Renderer being set to nullptr. The attached test case illustrates this problem.

It seems to be related to the specific use of "-webkit-image-set".

There might be some relationship between the size of the containing div and the native size of the images used in this test case.
Comment 1 Radar WebKit Bug Importer 2016-07-01 13:48:31 PDT
<rdar://problem/27138301>
Comment 2 Brent Fulgham 2016-07-01 13:51:38 PDT
This markup shows the problem:

<div style="width: 572px; height: 572px">
    <img id="target" src="resources/test_image.jpg" style="content: -webkit-image-set(url(resources/test_image_1x.jpg) 1x); width: 100%; height: 100%;">
</div>
Comment 3 Brent Fulgham 2016-07-01 14:11:13 PDT
(In reply to comment #2)
> This markup shows the problem:
> 
> <div style="width: 572px; height: 572px">
>     <img id="target" src="resources/test_image.jpg" style="content:
> -webkit-image-set(url(resources/test_image_1x.jpg) 1x); width: 100%; height:
> 100%;">
> </div>

The scaling is not needed. This is sufficient to trigger the bug:

<!DOCTYPE html>
<html>
<body>
    <img src="resources/test_image.jpg" style="content: -webkit-image-set(url(resources/test_image_1x.jpg) 1x); width: 100%; height: 100%;">
</body>
</html>
Comment 4 Brent Fulgham 2016-07-01 17:06:33 PDT
I think this might only happen when you have an "image-set" that only contains a 1x image, and you attempt to do the copy on a retina system.
Comment 5 Simon Fraser (smfr) 2016-07-02 17:25:44 PDT
Is this actually a crash?
Comment 6 Brent Fulgham 2016-07-05 08:43:59 PDT
(In reply to comment #5)
> Is this actually a crash?

Yes, although I fixed the specific crash that caused me to notice this problem in Bug 159288. Now we do not crash, but attempts to copy the image result in a blank pasteboard buffer.