New issue
Advanced search Search tips

Issue 618871 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Narrow the criteria used for canvas tainting for canvas filters

Project Member Reported by ajuma@chromium.org, Jun 9 2016

Issue description

Currently, all canvas filters refer to SVG filters taint the canvas, unless they consist only of some combination of SourceGraphic, SourceAlpha, FillPaint, StrokePaint, feColorMatrix, and feMerge. (See  issue 571048 .) This is more restrictive than what we actually need: we only need to make sure that the canvas is tainted when there's a filter node that includes cross-origin content. For example, a cross-origin feImage must taint the canvas. So the work that needs to be done here is expanding the whitelist introduced in r381961 to include all effects that don't refer to cross-origin content.
 
Project Member

Comment 1 by sheriffbot@chromium.org, Jun 12 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Recharge-Cold PaintTeamTriaged-20170612 BugSource-Team
Status: Available (was: Untriaged)
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 13 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by junov@chromium.org, Jun 21 2018

Status: Available (was: Untriaged)
Cc: -junov@chromium.org
Cc: fs...@chromium.org
Owner: aaronhk@chromium.org
Status: Assigned (was: Available)
For reference, this stackoverflow question is caused by this particular bug: https://stackoverflow.com/questions/51602474/svg-filter-taints-canvas

Currently, there's no good way to "turn off" antialiasing for 2d context, and the SVG filter solution was proposed in this question: https://stackoverflow.com/questions/4261090/html5-canvas-and-anti-aliasing

This is particularly relevant when using a second 2d context for Picking objects by unique color values.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/133cbb6cda368c7a111a7867c32df70e16a79b14

commit 133cbb6cda368c7a111a7867c32df70e16a79b14
Author: Aaron Krajeski <aaronhk@google.com>
Date: Fri Nov 16 21:01:33 2018

Filters containing feImage with local content no longer taint canvas.

Provide a pointer to SecurityOrigin within SVGFEImageElement so that
it can test if its content actually taints the origin. Previously all
filters with feImages tainted the canvas. When the filter is set
(during CanvasRenderingContext2DState::SetFilter) the SecurityOrigin
is stored. During CanvasRenderingContext2DState::GetFilter is it
determined whether the compiled filter should taint the canvas.

Next step is to make this work for other svg_fe elements.

Change the test expectations for SVGFEDisplacment tests as FEImages
no longer necessarily taint the origin. Reverting changes here:
https://chromium-review.googlesource.com/c/chromium/src/+/782649/

Bug: 618871
Change-Id: I506c443f842068f08eab0e3d6b214f2b10878a86
Reviewed-on: https://chromium-review.googlesource.com/c/1258968
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608934}
[add] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/fast/canvas/resources/link-xhtml.svg
[add] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/http/tests/canvas/svg-image-taint-canvas.html
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/custom/feDisplacementMap-01-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-dom-in-attr-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-dom-in2-attr-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-dom-scale-attr-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-dom-xChannelSelector-attr-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-dom-yChannelSelector-attr-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-svgdom-in-prop-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-svgdom-in2-prop-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-svgdom-scale-prop-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-svgdom-xChannelSelector-prop-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGFEDisplacementMapElement-svgdom-yChannelSelector-prop-expected.png
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/blink/renderer/core/svg/svg_fe_image_element.cc
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/blink/renderer/core/svg/svg_fe_image_element.h
[modify] https://crrev.com/133cbb6cda368c7a111a7867c32df70e16a79b14/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.cc

Sign in to add a comment