Closed Bug 2004736 Opened 7 months ago Closed 6 months ago

Handle SVG theming in moz-remote-image

Categories

(Core :: Graphics, task)

task

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

We need to make sure SVGs that are loaded via the moz-remote-image: protocol get the correct theme (CSS's prefers-color-scheme). We might also want to handle context-fill, but that really should not be used by web content.

No longer depends on: 1985987
Depends on: 1985987

We need to add parameters to moz-remote-image for color-scheme, fill/stroke color/opacity and forward that to the child. The question is how we would even collect that information. It does feel somewhat unfortunate having to do that for e.g. favicons in JS.

In the child, I think we need to do something similar to nsWindowGfx::CreateIcon, where we set-up an SVGImageContext and call imgIContainer::Draw instead of imgContainer::GetFrame. I believe we also need to fake a nsISVGPaintContext, similar to this test.

Assignee: nobody → tschuster
Attachment #9531818 - Attachment description: WIP: Bug 2004736 → Bug 2004736 - Support colorScheme parameter for SVG in moz-remote-image:. r?tnikkel

I only did color-scheme for now, but support for fill-color etc. should be trivial to add.

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
QA Whiteboard: [qa-triage-done-c150/b149]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: