Bug 202826 - Outsets for referenced SVG filters are always zero
Summary: Outsets for referenced SVG filters are always zero
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
: 166739 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-10 14:38 PDT by Said Abou-Hallawa
Modified: 2019-10-25 09:41 PDT (History)
17 users (show)

See Also:


Attachments
test case (581 bytes, text/html)
2019-10-10 14:38 PDT, Said Abou-Hallawa
no flags Details
Patch (21.28 KB, patch)
2019-10-10 15:26 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (25.60 KB, patch)
2019-10-11 10:31 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (26.61 KB, patch)
2019-10-11 10:44 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (27.38 KB, patch)
2019-10-14 15:58 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2019-10-10 14:38:33 PDT
Created attachment 380688 [details]
test case

Open the attached test case.

Result: A blurred green rectangle.
Expected: A solid green rectangle.

In the test case, there is an 800x800 <div> element filled with "background-color: green;". An SVG filter applied to this <div> with the effect: "<fegaussianblur stdDeviation="100">". This filtered element is transformed by: "translate(-300px, -300px)" and it is placed inside another container 100x100 <div> whose "overflow: hidden;". So the container element shows only the rectangle { location = { 300, 300 }, size = { 100, 100 } } of the filtered element. This means none of the filter blurred pixels should be shown.
Comment 1 Said Abou-Hallawa 2019-10-10 15:26:30 PDT
Created attachment 380693 [details]
Patch
Comment 2 Said Abou-Hallawa 2019-10-10 15:28:09 PDT
<rdar://problem/55791120>
Comment 3 Said Abou-Hallawa 2019-10-11 10:31:04 PDT
Created attachment 380761 [details]
Patch
Comment 4 Said Abou-Hallawa 2019-10-11 10:44:18 PDT
Created attachment 380763 [details]
Patch
Comment 5 Said Abou-Hallawa 2019-10-11 11:53:32 PDT
Comment on attachment 380763 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=380763&action=review

> Source/WebCore/rendering/CSSFilter.cpp:-380
> -        rectForRepaint.move(-m_outsets.right(), -m_outsets.bottom());

I think the old calculation is wrong. I could not understand what "going backwards" means here and how this is translated to offsetting the rectangle by (-right, -bottom) instead of (-left, -top).
Comment 6 Said Abou-Hallawa 2019-10-14 15:58:33 PDT
Created attachment 380929 [details]
Patch
Comment 7 WebKit Commit Bot 2019-10-14 19:00:44 PDT
Comment on attachment 380929 [details]
Patch

Clearing flags on attachment: 380929

Committed r251119: <https://trac.webkit.org/changeset/251119>
Comment 8 WebKit Commit Bot 2019-10-14 19:00:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Said Abou-Hallawa 2019-10-15 14:43:38 PDT
(In reply to Truitt Savell from comment #9)
> The new test css3/filters/svg-blur-filter-clipped.html added in
> https://trac.webkit.org/changeset/251119/webkit
> 
> is failing on iOS
> 
> History:
> https://results.webkit.org/?suite=layout-tests&test=css3%2Ffilters%2Fsvg-
> blur-filter-clipped.html
> 
> Diff:
> https://build.webkit.org/results/
> Apple%20iOS%2013%20Simulator%20Release%20WK2%20(Tests)/r251149%20(545)/css3/
> filters/svg-blur-filter-clipped-diffs.html

But it was skipped in LayoutTests/platform/iOS/TestExpectations in the r251119. So how can it fail?
Comment 11 Russell Epstein 2019-10-16 10:10:20 PDT
(In reply to Said Abou-Hallawa from comment #10)
> (In reply to Truitt Savell from comment #9)
> > The new test css3/filters/svg-blur-filter-clipped.html added in
> > https://trac.webkit.org/changeset/251119/webkit
> > 
> > is failing on iOS
> > 
> > History:
> > https://results.webkit.org/?suite=layout-tests&test=css3%2Ffilters%2Fsvg-
> > blur-filter-clipped.html
> > 
> > Diff:
> > https://build.webkit.org/results/
> > Apple%20iOS%2013%20Simulator%20Release%20WK2%20(Tests)/r251149%20(545)/css3/
> > filters/svg-blur-filter-clipped-diffs.html
> 
> But it was skipped in LayoutTests/platform/iOS/TestExpectations in the
> r251119. So how can it fail?

The test expectation was defined as "Failure" which means it is expecting a TEXT failure. Since this test produces an image, the expectation needs to be "ImageOnlyFailure".

I've corrected the TestExpectation in r251189.
Comment 12 Said Abou-Hallawa 2019-10-25 09:41:46 PDT
*** Bug 166739 has been marked as a duplicate of this bug. ***