This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26432 - Specify that filter regions clip input
Summary: Specify that filter regions clip input
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Filter Effects (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 23:44 UTC by Max Vujovic
Modified: 2015-02-11 04:44 UTC (History)
4 users (show)

See Also:


Attachments
Reftest (1.92 KB, image/svg+xml)
2014-07-24 23:44 UTC, Max Vujovic
Details
Reftest reference file (862 bytes, image/svg+xml)
2014-07-24 23:44 UTC, Max Vujovic
Details
Reftest: All browsers clip the input SourceGraphic to the filter region. (1.75 KB, image/svg+xml)
2014-11-03 22:17 UTC, Max Vujovic
Details
Reftest: Primitive subregions don't clip input in most browsers (1.64 KB, image/svg+xml)
2014-11-03 22:52 UTC, Max Vujovic
Details

Description Max Vujovic 2014-07-24 23:44:07 UTC
Created attachment 1499 [details]
Reftest

Currently, the spec says:
"The bounds of this rectangle [the filter region] act as a hard clipping region for each filter primitive included with a given filter element; thus, if the effect of a given filter primitive would extend beyond the bounds of the rectangle (this sometimes happens when using a feGaussianBlur filter primitive with a very large stdDeviation), parts of the effect will get clipped." [1]

I interpret this as the output of a filter is clipped to its filter region, and nothing is said about clipping the input.

Currently, all UAs I've tested (Chrome, Firefox, IE, Safari) clip the input SourceGraphic to the filter region (as I would expect). I think we should add that to the spec.

I wrote a reftest and attached it.

[1]: http://dev.w3.org/fxtf/filters/#FilterRegionXYWidthHeightAttributes
Comment 1 Max Vujovic 2014-07-24 23:44:49 UTC
Created attachment 1500 [details]
Reftest reference file
Comment 2 Max Vujovic 2014-07-24 23:53:33 UTC
Maybe I spoke too soon- Safari is rendering white on my reftest. I expected a green rect. (The other UAs draw a green rect.) This might be a different bug though. If I recall correctly, Safari clips input using the filter region.
Comment 3 Dirk Schulze 2014-11-03 21:36:39 UTC
Section "Filter primitive subregion" says "The filter primitive subregion act as a hard clip clipping rectangle on both the filter primitive’s input image(s) and the filter primitive result.".

Since every primitive has a primitive subregion, isn't that the same as saying the input is clipped to the filter region? Especially with the comment in the next paragraph:

"All intermediate offscreens are defined to not exceed the intersection of the filter primitive subregion with the filter region."

Do you disagree?

http://dev.w3.org/fxtf/filters/#FilterPrimitiveSubRegion
Comment 4 Max Vujovic 2014-11-03 22:12:33 UTC
(In reply to Dirk Schulze from comment #3)
> Do you disagree?

I agree. If the filter primitive subregion clips input and intermediate offscreens cannot exceed the filter region, I believe that's the same as saying the filter region clips the input.

IIRC, no browsers actually use the filter primitive subregion to clip a previous filter primitive's input. They only use it to clip a filter primitive's output.

However, I believe all browsers use the filter region to clip input. (I will attach a better test case shortly.)

To match all the implementations, I'd change the spec to say filter primitive subregions clip their primitive's output, and filter regions clip the input SourceGraphic (or other input).

I don't see any harm in primitive subregions not clipping input. You can achieve the same result by inserting an extra no-op primitive of some kind with a primitive subregion if you really want to clip both input and output.

This is probably a separate bug, though. The current spec language does work for filter regions clipping input via filter primitive subregion input clipping.
Comment 5 Max Vujovic 2014-11-03 22:17:31 UTC
Created attachment 1532 [details]
Reftest: All browsers clip the input SourceGraphic to the filter region.

This is a simpler example that works in Safari, IE11, Firefox, and Chrome.

The previous example was running into some other seemingly unrelated issue in Safari.
Comment 6 Dirk Schulze 2014-11-03 22:23:41 UTC
(In reply to Max Vujovic from comment #4)
> (In reply to Dirk Schulze from comment #3)
> > Do you disagree?
> 
> I agree. If the filter primitive subregion clips input and intermediate
> offscreens cannot exceed the filter region, I believe that's the same as
> saying the filter region clips the input.
> 
> IIRC, no browsers actually use the filter primitive subregion to clip a
> previous filter primitive's input. They only use it to clip a filter
> primitive's output.
> 
> However, I believe all browsers use the filter region to clip input. (I will
> attach a better test case shortly.)
> 
> To match all the implementations, I'd change the spec to say filter
> primitive subregions clip their primitive's output, and filter regions clip
> the input SourceGraphic (or other input).
> 
> I don't see any harm in primitive subregions not clipping input. You can
> achieve the same result by inserting an extra no-op primitive of some kind
> with a primitive subregion if you really want to clip both input and output.
> 
> This is probably a separate bug, though. The current spec language does work
> for filter regions clipping input via filter primitive subregion input
> clipping.

I found it hard to observe. In my tests not even browsers are that consistent. IE sometimes clips the input as well. But it doesn't do it all the time. I brought this up to the WG twice. The second time with the intention to undo the input clipping. In both cases the WG (and the UA reps with them) wanted to keep the introduced primitive input clipping. I would bring it up a third time if you raise an objection with the change.
Comment 7 Max Vujovic 2014-11-03 22:52:41 UTC
Created attachment 1533 [details]
Reftest: Primitive subregions don't clip input in most browsers

This test shows that filter primitive subregions don't clip input in Safari, Firefox, and Chrome. In IE11, I get an unexpected result (the green square isn't offset at all), so I'd say it's inconclusive.
Comment 8 Max Vujovic 2014-11-03 23:39:37 UTC
(In reply to Dirk Schulze from comment #6)
> I found it hard to observe. In my tests not even browsers are that
> consistent. IE sometimes clips the input as well. But it doesn't do it all
> the time. I brought this up to the WG twice. The second time with the
> intention to undo the input clipping. In both cases the WG (and the UA reps
> with them) wanted to keep the introduced primitive input clipping. I would
> bring it up a third time if you raise an objection with the change.

Sounds good. I posted my thoughts to the list:
http://lists.w3.org/Archives/Public/public-fx/2014OctDec/0043.html
Comment 9 Dirk Schulze 2015-02-11 04:44:44 UTC
(In reply to Max Vujovic from comment #8)
> (In reply to Dirk Schulze from comment #6)
> > I found it hard to observe. In my tests not even browsers are that
> > consistent. IE sometimes clips the input as well. But it doesn't do it all
> > the time. I brought this up to the WG twice. The second time with the
> > intention to undo the input clipping. In both cases the WG (and the UA reps
> > with them) wanted to keep the introduced primitive input clipping. I would
> > bring it up a third time if you raise an objection with the change.
> 
> Sounds good. I posted my thoughts to the list:
> http://lists.w3.org/Archives/Public/public-fx/2014OctDec/0043.html

We resolved to accept the proposal.(In reply to Max Vujovic from comment #8)
> (In reply to Dirk Schulze from comment #6)
> > I found it hard to observe. In my tests not even browsers are that
> > consistent. IE sometimes clips the input as well. But it doesn't do it all
> > the time. I brought this up to the WG twice. The second time with the
> > intention to undo the input clipping. In both cases the WG (and the UA reps
> > with them) wanted to keep the introduced primitive input clipping. I would
> > bring it up a third time if you raise an objection with the change.
> 
> Sounds good. I posted my thoughts to the list:
> http://lists.w3.org/Archives/Public/public-fx/2014OctDec/0043.html


The proposal was accepted and is part of the specification.