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

[filter-effects] Clarify what happens with failing pre-conditions on feConvolveMatrix #237

Open
dirkschulze opened this issue Dec 28, 2017 · 4 comments

Comments

@dirkschulze
Copy link
Contributor

@dirkschulze dirkschulze commented Dec 28, 2017

feConvolveMatrix does specify conditions for attributes but does not specify what happens if those conditions were not fulfilled by the author.

@dirkschulze dirkschulze changed the title What [filter-effects] Clarify what happens with failing pre-conditions on feConvolveMatrix Dec 28, 2017
@upsuper
Copy link
Member

@upsuper upsuper commented Dec 29, 2017

(FWIW, I tend to think that if you forgot to fill the content with something reasonable, it is probably better just close the issue, and optionally leave a comment mentioning that this was a mistake, then open a new one. This way people wouldn't need to open the GitHub page to know what's happening, and the content can be properly archived in W3C mailing list as well.)

@dirkschulze
Copy link
Contributor Author

@dirkschulze dirkschulze commented Dec 31, 2017

I used this simple example to verify the behavior in implementations:

<svg width="100%" height="220" style="outline: 1px solid red" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
   <filter id="convolve">
      <feFlood flood-color="green" result="flood"/>
      <feConvolveMatrix kernelMatrix="1 0 0 0 1 0 0 0 -1 0" in="SourceGraphic" result="kernel"/>
      <feComposite operator="over" in="kernel" in2="flood"/>
   </filter>
 </defs> 

 <g font-size="3em">
   <text x="225" y="75">Convolve</text>
   <text x="225" y="150" filter="url(#convolve)">Convolve</text>
 </g>
</svg>
  • Firefox and Chrome treat the result of feConvolveMatrix as transparent black on failing preconditions.
  • Safari does not render the entire element.
  • Adobe Illustrator/PS and Edge make the filter a pass through.

The pass through seems to be more in line to the behavior of browsers with failing preconditions on feColorMatrix's values attribute. Here all browsers use the "initial value" instead which makes the filter a pass-through.

Edit: Added results for Edge

dirkschulze added a commit that referenced this issue Dec 31, 2017
…on unfulfilled pre-conditions. Issue #237. Add defintion of filter primitive tree.
@AmeliaBR
Copy link

@AmeliaBR AmeliaBR commented Jan 1, 2018

I would expect that an invalid kernelMatrix value would be treated equivalently to no kernelMatrix attribute at all.

This was effectively how it worked with <feColorMatrix>, even if it wasn't explicitly specified. The fact that this causes the primitive to becomes a no-op or "pass-through" effect is a consequence of those initial values. However, <feConvolveMatrix> didn't have clearly defined default values to start out with.

I'm certainly happy to define it such that invalid values result in a no-op primitive, but I'd like to be clear that a missing kernelMatrix attribute has the same effect as an invalid one. The edits in 581a079 seem to me to be working around the issue without clearly defining an initial value for kernelMatrix.

@AmeliaBR
Copy link

@AmeliaBR AmeliaBR commented Jan 1, 2018

PS, a correction: Edge doesn't treat the <feConvolveMatrix> with incorrect # of values in kernelMatrix as a no-op. Instead, it seems to pad the value with zeros or truncate extras. It just happened that for the default 3x3 order in your example, that resulted in something close to a no-op effect. You might want to double check the Illustrator/Photoshop results for a different matrix, or when you throw a different order attribute on your example (order="4" creates a noticeable blur in Edge).

chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Apr 7, 2020
…st to WPT"

This reverts commit b4687c72a621f6667dc95744032c3db263b862ec.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Apr 7, 2020
…st to WPT"

This reverts commit b4687c72a621f6667dc95744032c3db263b862ec.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138937
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#757037}
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this issue Apr 7, 2020
…st to WPT"

This reverts commit b4687c7.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138937
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#757037}
chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Apr 7, 2020
…st to WPT"

This reverts commit b4687c72a621f6667dc95744032c3db263b862ec.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138937
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#757037}
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Apr 13, 2020
…erence-convolve-error.html test to WPT", a=testonly

Automatic update from web-platform-tests
Revert "[css-filters] Migrate effect-reference-convolve-error.html test to WPT"

This reverts commit b4687c72a621f6667dc95744032c3db263b862ec.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138937
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#757037}

--

wpt-commits: 180976ed3456786748574743fbbed0dd53fb8a90
wpt-pr: 22741
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 13, 2020
…erence-convolve-error.html test to WPT", a=testonly

Automatic update from web-platform-tests
Revert "[css-filters] Migrate effect-reference-convolve-error.html test to WPT"

This reverts commit b4687c72a621f6667dc95744032c3db263b862ec.

This WPT testcase is failing on FF and Safari because its chrome
specific behaviour.

feConvolveMatrix does specify conditions for attributes but does not
specify what happens if those conditions were not fulfilled by the
author and there is a on going dicussion in W3C github [1].

[1] w3c/fxtf-drafts#237

Bug: 1063749
Change-Id: I56ae0883f9891ff336128e5b3e15014c7e4b384f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138937
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#757037}

--

wpt-commits: 180976ed3456786748574743fbbed0dd53fb8a90
wpt-pr: 22741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.