| Index: Source/core/svg/SVGFEGaussianBlurElement.cpp
|
| diff --git a/Source/core/svg/SVGFEGaussianBlurElement.cpp b/Source/core/svg/SVGFEGaussianBlurElement.cpp
|
| index c322d8dfd379d22cc1ca5fd6183bf7e28e4d1f6a..cfb1503edc502291f1c3ddb4485c5fb09b9acf3c 100644
|
| --- a/Source/core/svg/SVGFEGaussianBlurElement.cpp
|
| +++ b/Source/core/svg/SVGFEGaussianBlurElement.cpp
|
| @@ -72,10 +72,14 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBu
|
| if (!input1)
|
| return nullptr;
|
|
|
| - if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->currentValue()->value() < 0)
|
| - return nullptr;
|
| -
|
| - RefPtrWillBeRawPtr<FilterEffect> effect = FEGaussianBlur::create(filter, stdDeviationX()->currentValue()->value(), stdDeviationY()->currentValue()->value());
|
| + // "A negative value or a value of zero disables the effect of the given
|
| + // filter primitive (i.e., the result is the filter input image)."
|
| + // (https://drafts.fxtf.org/filters/#element-attrdef-fegaussianblur-stddeviation)
|
| + //
|
| + // => Clamp to non-negative.
|
| + float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
|
| + float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
|
| + RefPtrWillBeRawPtr<FilterEffect> effect = FEGaussianBlur::create(filter, stdDevX, stdDevY);
|
| effect->inputEffects().append(input1);
|
| return effect.release();
|
| }
|
|
|