Closed Bug 1404366 Opened 2 years ago Closed 2 years ago

Favicon.ico pink rendering

Categories

(Core :: ImageLib, defect, P3)

57 Branch
All
Unspecified
defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: mte90net, Assigned: tnikkel)

References

(Blocks 1 open bug)

Details

(Whiteboard: [gfx-noted])

Attachments

(3 files)

Attached image wrong colors
When you open the website http://www.dati.gov.it/ and switch the tabs (when you are in that tab the colors are right) you can see that the icon is blinking in pink and next in white colors.

The icon link http://www.dati.gov.it/sites/default/files/datigovit_0.ico

Probably is the theme that I am using that alter the icon? As I can see when I hover the tab the image became with a white background but when I am in the tab the colors are right.
Attached image correct.png
This should be the real colors
As I can see on Developer edition (57) switch only to pink while on nightly (58) there is the white blink.
(In reply to Daniele "Mte90" Scasciafratte from comment #0)
> Probably is the theme that I am using that alter the icon? As I can see when
> I hover the tab the image became with a white background but when I am in
> the tab the colors are right.

Hi Daniele, I can reproduce the same bug in Nightly with the default theme, thus it's not your theme.
This is puzzling... Also opening just the icon link in comment 0 shows it.
The tabbed browser favicon code only sets the image attribute, so here looks like something may be wrong at a graphics/imageLib/layout level. It seems to happen when we apply the tab hover attribute.
The problem goes away commenting out any of these rules

.tab-line:not([selected=true]) {
  opacity: 0;
  transform: scaleX(0);
  transition: transform 250ms var(--animation-easing-function), opacity 250ms var(--animation-easing-function);
}

.tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]) {
  background-color: rgba(0,0,0,.2);
  opacity: 1;
  transform: none;
}

Dao, any idea?
Flags: needinfo?(dao+bmo)
also ni Milan, since it honestly looks like something related to graphics or layers composition. But I'm really guessing.
Flags: needinfo?(milan)
(In reply to Marco Bonardo [::mak] from comment #4)
> The problem goes away commenting out any of these rules
> 
> .tab-line:not([selected=true]) {
>   opacity: 0;
>   transform: scaleX(0);
>   transition: transform 250ms var(--animation-easing-function), opacity
> 250ms var(--animation-easing-function);
> }
> 
> .tabbrowser-tab:hover > .tab-stack > .tab-background >
> .tab-line:not([selected=true]) {
>   background-color: rgba(0,0,0,.2);
>   opacity: 1;
>   transform: none;
> }
> 
> Dao, any idea?

Just like bug 1401122 comment 15. Something very weird is going on on the Gecko side.
Flags: needinfo?(dao+bmo)
See Also: → 1401122, 1387296
Yes, Andrew has looked at this a bit, and can continue - bug 1401122 comment 17 may help triaging this.
Flags: needinfo?(milan) → needinfo?(aosmond)
Component: Tabbed Browser → Layout
Product: Firefox → Core
I posted two versions of this page to show the difference in favicon handing between ICO and PNG files:

http://media.junglecode.net/test/1404366/datigovit_0.png.html
http://media.junglecode.net/test/1404366/datigovit_0.ico.html

Note the masking and color glitches only on the ICO version. These errors don't appear on high-res displays or when image.downscale-during-decode.enabled is set to false.
Component: Layout → Layout: Images
I'm moving this to ImgLib as it's clearly a BMP decoding/downscaling bug as indicated in comment 8.
Component: Layout: Images → ImageLib
Priority: -- → P3
Whiteboard: [gfx-noted]
Timothy is already looking at this.
Flags: needinfo?(aosmond) → needinfo?(tnikkel)
Attached patch patchSplinter Review
Assignee: nobody → tnikkel
Flags: needinfo?(tnikkel)
Attachment #8922612 - Flags: review?(aosmond)
Blocks: 1206836
Attachment #8922612 - Flags: review?(aosmond) → review+
Checking now the icon doesn't became anymore pink but only transparent/white on switching of tabs.
Blocks: 1425016
Is this patch ready to land?
Flags: needinfo?(tnikkel)
I spent some time creating a test for this and finding more bugs. I have it working now, I just have to package the test and land.
Pushed by tnikkel@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bba778f860d2
Convert the image data for BMPs inside ICOs that has a mask to premultiplied alpha as expected. r=aosmond
Flags: needinfo?(tnikkel)
https://hg.mozilla.org/mozilla-central/rev/bba778f860d2
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Duplicate of this bug: 1435162
QA Whiteboard: [good first verify]
Duplicate of this bug: 1423632
You need to log in before you can comment on or make changes to this bug.