Bug 258310

Summary: Update handling of negative std.dev for feGaussianblur/feDropShadow
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: karlcow, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
test case none

Ahmad Saleem
Reported 2023-06-20 11:12:11 PDT
Hi Team, I came across another failing test compared to Chrome Canary 116 in Safari Technology Preview 172 (though matching Firefox Nightly 116). Blink Commit: https://src.chromium.org/viewvc/blink?view=revision&revision=202643 Test Case: https://jsfiddle.net/t4ewy9z0/ (feGaussianBlur-negative-deviation.svg) & https://jsfiddle.net/6rx1t3ek/ (feDropShadow-negative-deviation.svg) It seems that spec changed and our current behavior is similar to Firefox Nightly but Blink aligned with web-spec. We already have these tests because of change in 2013 by David (pre-blink fork). Web-Spec: https://drafts.fxtf.org/filter-effects/#element-attrdef-fegaussianblur-stddeviation _______________ @Simon & @Said - any input, I am happy to do PR to fix it. Thanks!
Attachments
test case (450 bytes, image/svg+xml)
2023-06-27 15:44 PDT, Said Abou-Hallawa
no flags
Radar WebKit Bug Importer
Comment 1 2023-06-27 11:13:18 PDT
Said Abou-Hallawa
Comment 2 2023-06-27 11:56:51 PDT
This is a degenerate case. Currently WebKit disables the effect of the whole filter graph if the standard deviation is negative. See this code in buildFilterEffectsGraph(): auto effect = effectElement.filterEffect(*inputs, destinationContext); if (!effect) return std::nullopt; And see this code in SVGFEDropShadowElement::createFilterEffect(): if (stdDeviationX() < 0 || stdDeviationY() < 0) return nullptr;
Ahmad Saleem
Comment 3 2023-06-27 15:23:46 PDT
(In reply to Said Abou-Hallawa from comment #2) > This is a degenerate case. > > Currently WebKit disables the effect of the whole filter graph if the > standard deviation is negative. See this code in buildFilterEffectsGraph(): > > auto effect = effectElement.filterEffect(*inputs, destinationContext); > if (!effect) > return std::nullopt; > > And see this code in SVGFEDropShadowElement::createFilterEffect(): > > if (stdDeviationX() < 0 || stdDeviationY() < 0) > return nullptr; Good help! I was not aware of 'buildFilterEffectsGraph' part, should I do PR to match Chrome's behavior since it is aligned with web-spec?
Said Abou-Hallawa
Comment 4 2023-06-27 15:44:42 PDT
Created attachment 466835 [details] test case
Note You need to log in before you can comment on or make changes to this bug.