| Summary: | background-image filter() function does not do retina scaling | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | frankhome61 | ||||
| Component: | CSS | Assignee: | Kiet Ho <kiet.ho> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | dino, kiet.ho, mmaxfield, sabouhallawa, simon.fraser, thorton, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Other | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
The fast/filter-image/background-filter-image.html is currently passing at least on macOS. This is true because WKR and DRT work on 1x mode. To fix this bug we need to move this test to fast/hidpi and include this line at the beginning:
<script src="resources/ensure-hidpi.js"></script>
Pull request: https://github.com/WebKit/WebKit/pull/15021 |
Created attachment 407843 [details] Left is applying filter on an img node, right is applying filter on a background-image There is a test case, fast/filter-image/background-filter-image.html that is testing the result of rendering background-image with filters. However there is a problem where current WebKit doesn't render the background image on Retina screens properly. In this test, background-filter-image.html uses background-image: filter(url(../replaced/resources/compass.jpg), sepia(1)); to apply a sepia filter on the background image of a div; we are comparing against the reference test, fast/filter-image/background-filter-image-expected.html, which is just applying a sepia filter on a img node. img { width: 100px; height: 100px; filter: sepia(1); } <img src="../replaced/resources/compass.jpg"> I have included a screenshot of the comparison: on the left we can see a sharp image, which is from fast/filter-image/background-filter-image-expected.html; on the right is a lower quality image from fast/filter-image/background-filter-image.html. Seems that we didn't upscale the image on retina screens when rendering background-image