Closed Bug 1682083 Opened 4 years ago Closed 3 years ago

filter: invert() is not always applied correctly to the background color of the html element

Categories

(Core :: Web Painting, defect, P3)

Firefox 83
defect

Tracking

()

RESOLVED DUPLICATE of bug 1423746
Webcompat Priority P1
Tracking Status
firefox100 --- affected

People

(Reporter: oleg-derevenetz, Unassigned)

References

Details

Attachments

(2 files)

Attached file demo.html (deleted) —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Steps to reproduce:

<!DOCTYPE html>
<html style="width: 100%; height: 100%; margin: 0; padding: 0; color: #000; background: #f00; filter: invert(1);">
<head>
<title>Test</title>
</head>
<body style="min-width: 100%; min-height: 100%; margin: 0; padding: 0; color: #000; background: #fff;">
<p style="margin: 20px auto;">Text</p>
</body>
</html>

Actual results:

With Firefox, background color of upper margin space is not inverted (remains red).

Expected results:

With Chromium-based browsers, background color of upper margin space is inverted as expected (becomes cyan).

Blocks: 869828
Component: Untriaged → Graphics
Product: Firefox → Core
Attached file display list dump (deleted) —

This is a long-standing issue, dates back to at least 2017-01-01. Occurs with either webrender enabled or disabled.

You can see in the display list dump that the Filter is a child of the red CanvasBackgroundColor, so I guess this is an issue in display list building.

Miko, Matt, any ideas?

Severity: -- → S3
Component: Graphics → Web Painting
Flags: needinfo?(mikokm)
Flags: needinfo?(matt.woodrow)
Priority: -- → P3

I suspect this is just bug 1423746.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

I suspect this is just bug 1423746.

Indeed, I think it is too.

Flags: needinfo?(matt.woodrow)
Flags: needinfo?(mikokm)

I found this bug in the wild and posted a question about it on stackoverflow.com and then discovered this bug report.
I noticed that on Chrome it actually behaves differently whether the page is in an iframe or not, so I think that's also a Chrome bug.
Here is my example:
https://stackoverflow.com/questions/67115220/why-does-filter-render-differently-in-different-browsers-on-the-html-and-body-ta

[Tracking Requested - why for this release]:

Probably this should be a WebCompat Priority 1.
It affects Google Search -> Shopping as seen in
https://github.com/webcompat/web-bugs/issues/95222

Webcompat Priority: --- → P1
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: