Bug 254062 - [Filters] Calculating the CSSFilter geometry and clipping sometimes is incorrect
Summary: [Filters] Calculating the CSSFilter geometry and clipping sometimes is incorrect
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
Depends on:
Blocks:
 
Reported: 2023-03-16 22:43 PDT by Said Abou-Hallawa
Modified: 2023-03-18 12:29 PDT (History)
4 users (show)

See Also:


Attachments
test case (does not work on Retina display) (267 bytes, text/html)
2023-03-16 22:45 PDT, Said Abou-Hallawa
no flags Details
test case 2 (incorrect filter geometry) (667 bytes, text/html)
2023-03-16 22:48 PDT, Said Abou-Hallawa
no flags Details
test case 3 (unclipped filter region) (662 bytes, text/html)
2023-03-17 09:36 PDT, Said Abou-Hallawa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2023-03-16 22:43:25 PDT
Like SVGFilter, CSSFilter should always intersect the FilterEffect imageRect with its primitiveSubregion. This will require:

1. Filter::ClipOperation will be removed.
2. Filter::clipToMaxEffectRect() will always clip the rectangle with maxEffectRect.
3. FilterEffect::calculateImageRect() will return the maxEffectRect if number of input effects is zero. This was a bug which was covered by the union mode of Filter::clipToMaxEffectRect().
4. RenderLayerFilters::beginFilterEffect() should set its targetBoundingBox the sourceImageRect of FilterTargetSwitcher.
5. SVGFilterGraph::getNamedNodes() should not return an error if one of the inputs is builtin and there is no node for it. This happens when we build a graph of primitives and one of the inputs is SourceGraphic or SourceAlpha. In this case we just need to ignore this input since there is no built-in primitive for it. This fixes the calculation of the filter outsets which was covered by  the union mode of Filter::clipToMaxEffectRect().
Comment 1 Said Abou-Hallawa 2023-03-16 22:45:28 PDT
Created attachment 465472 [details]
test case (does not work on Retina display)
Comment 2 Said Abou-Hallawa 2023-03-16 22:48:56 PDT
Created attachment 465473 [details]
test case 2 (incorrect filter geometry)
Comment 3 Radar WebKit Bug Importer 2023-03-16 22:51:11 PDT
<rdar://problem/106844401>
Comment 4 Said Abou-Hallawa 2023-03-16 22:57:07 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11641
Comment 5 Said Abou-Hallawa 2023-03-17 09:36:24 PDT
Created attachment 465481 [details]
test case 3 (unclipped filter region)
Comment 6 EWS 2023-03-18 12:29:34 PDT
Committed 261827@main (7acdd2650a9b): <https://commits.webkit.org/261827@main>

Reviewed commits have been landed. Closing PR #11641 and removing active labels.