Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas2D filter and reset #493

Closed
2 of 3 tasks
benjamind opened this issue Sep 26, 2023 · 7 comments
Closed
2 of 3 tasks

Canvas2D filter and reset #493

benjamind opened this issue Sep 26, 2023 · 7 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@benjamind
Copy link

benjamind commented Sep 26, 2023

Description

The Canvas2D filter and reset functionality are the last two remaining pieces for full cross browser support for the Canvas2D APIs.

https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-reset
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-filter-dev

The reset functionality is of somewhat lesser importance and I don't think it is widely used, but Canvas2D filter support is extremely powerful and needs tests. Currently it is unimplemented in Safari only.

The filter functionality is in use by our apps at Adobe, though we are now having to build workarounds.

Specification

https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-reset

Open Issues

No response

Tests

No response

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

No response

Browser bug reports

https://bugs.webkit.org/show_bug.cgi?id=198416

There is an open PR for over a year, so support for this should be easy to land.

Developer discussions

No response

Polls & Surveys

No response

Existing Usage

No response

Workarounds

No good workarounds exist without full re-implementation of the filter functionality in WebGL and juggling of image data between Canvas2D and WebGL contexts to achieve the same effects. As far as I can see no polyfills exist.

Accessibility Impact

No response

Privacy Impact

No response

Other

No response

@tomayac
Copy link

tomayac commented Sep 26, 2023

FYI, here's a test case for CanvasRenderingContext2D.filter for how it should look like: https://canvas-svg-filter.glitch.me/:

Screenshot 2023-09-26 at 18 58 31

@nt1m
Copy link
Member

nt1m commented Oct 7, 2023

Canvas2D reset is shipping in STP fwiw

@fserb
Copy link

fserb commented Oct 16, 2023

I think it would be more useful to change this from "filter and reset" to "layers (with filter support) and reset", as current WhatWG discussions pointed out that filter support on layers is the agreed path forward by all browsers.

@foolip
Copy link
Member

foolip commented Oct 19, 2023

@fserb can you link to the WHATWG issue where that's being discussed?

@foolip
Copy link
Member

foolip commented Oct 25, 2023

Looks like @fserb is out of office, but I found whatwg/html#8476 + whatwg/html#9537.

@foolip
Copy link
Member

foolip commented Nov 1, 2023

@nairnandu and I have discussed with @fserb to understand the layers suggestion. Google would like to suggest adjusting the scope of this to be layers, which is the agreed-upon way to do filters. The complete test list would be:

@foolip
Copy link
Member

foolip commented Feb 1, 2024

Thank you for proposing Canvas2D filter and reset for inclusion in Interop 2024.

We wanted to let you know that this proposal was not selected to be part of Interop this year.

This is because we got many more proposals than we could include in this year's project. Note that individual vendors may nevertheless choose to advance work in this area during the forthcoming year. We would welcome this proposal being resubmitted again next year if necessary.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2024!

Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: Done
Development

No branches or pull requests

5 participants