-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add canvas filters #978
Conversation
This is looking like a pretty solid pull request! What is the status of this proposal in terms of implementer interest? |
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 |
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> |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
b3a0cbb
to
e058566
Compare
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Apologies, one final thing I missed, you need to add
to the list of acknowledgments. They do not appear to be listed there yet. |
Thanks for catching that, added them to the list. |
Great work @alijuma, thank you for addressing this longstanding bug! |
This is great! Thank you very much for driving this over the finish line. I'm sorry for completely dropping the ball here. Tobias Schneider is looking into finishing the Firefox implementation. |
This is based on the Canvas Filters proposal by Markus Stange, Tobias Schneider, and Tantek Çelik.
cc @mstange @junov