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

Add canvas filters #978

Merged
merged 1 commit into from
Apr 5, 2016
Merged

Add canvas filters #978

merged 1 commit into from
Apr 5, 2016

Conversation

alijuma
Copy link
Contributor

@alijuma alijuma commented Apr 1, 2016

This is based on the Canvas Filters proposal by Markus Stange, Tobias Schneider, and Tantek Çelik.

cc @mstange @junov

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Apr 1, 2016
@domenic
Copy link
Member

domenic commented Apr 1, 2016

This is looking like a pretty solid pull request! What is the status of this proposal in terms of implementer interest?

@alijuma
Copy link
Contributor Author

alijuma commented Apr 1, 2016

Blink and Firefox have already implemented this behind a flag.

Blink tracking bug: http://crbug.com/501642

Firefox tracking bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1173545

@annevk
Copy link
Member

annevk commented Apr 2, 2016

The commit message should mention this fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25243.


<p>If the value of the <code data-x="dom-context-2d-filter">filter</code> attribute refers to an
SVG filter in an external resource document and that document is not loaded when a drawing
operation is invoked, the drawing operation must proceed with no filtering.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this affect tainting? Are those documents always loaded using request mode "cors"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this affect tainting?

If the svg resource's DOM is accessible to the point that it is possible to reference a filter node, I think it is safe to assume that the resource is accessible to script. So I don't think there is any need for tainting.
Disclaimer: I am not a cors/security expert

@annevk annevk assigned annevk and unassigned junov Apr 4, 2016
@alijuma alijuma force-pushed the CanvasFilters branch 2 times, most recently from b3a0cbb to e058566 Compare April 4, 2016 21:18
@alijuma
Copy link
Contributor Author

alijuma commented Apr 4, 2016

Addressed comments.

<!-- NON-NORMATIVE SECTION -->

<p>Since drawing is peformed using filter value 'none' until an externally-defined
filter has finished loading, authors may wish to determine whether such a filter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use "might" instead of "may" since it's non-normative ("may" is a normative keyword).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@annevk
Copy link
Member

annevk commented Apr 5, 2016

Apologies, one final thing I missed, you need to add

  • Markus Stange
  • Tobias Schneider

to the list of acknowledgments. They do not appear to be listed there yet.

@alijuma
Copy link
Contributor Author

alijuma commented Apr 5, 2016

Thanks for catching that, added them to the list.

@annevk annevk merged commit 0c029fc into whatwg:master Apr 5, 2016
@annevk
Copy link
Member

annevk commented Apr 5, 2016

Great work @alijuma, thank you for addressing this longstanding bug!

@mstange
Copy link

mstange commented Apr 5, 2016

This is great! Thank you very much for driving this over the finish line. I'm sorry for completely dropping the ball here.
I didn't know you could use the <use> element to listen for external filter loads, this is a nice trick!

Tobias Schneider is looking into finishing the Firefox implementation.

@Kaiido Kaiido mentioned this pull request Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: canvas
Development

Successfully merging this pull request may close these issues.

5 participants