Bug 258310 - Update handling of negative std.dev for feGaussianblur/feDropShadow
Summary: Update handling of negative std.dev for feGaussianblur/feDropShadow
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-06-20 11:12 PDT by Ahmad Saleem
Modified: 2023-06-27 15:44 PDT (History)
5 users (show)

See Also:


Attachments
test case (450 bytes, image/svg+xml)
2023-06-27 15:44 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 Ahmad Saleem 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!
Comment 1 Radar WebKit Bug Importer 2023-06-27 11:13:18 PDT
<rdar://problem/111401717>
Comment 2 Said Abou-Hallawa 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;
Comment 3 Ahmad Saleem 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?
Comment 4 Said Abou-Hallawa 2023-06-27 15:44:42 PDT
Created attachment 466835 [details]
test case