Bug 237252 - [svg] fill-opacity should be clamped to the [0,1] range
Summary: [svg] fill-opacity should be clamped to the [0,1] range
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar, WebExposed, WPTImpact
Depends on:
Blocks:
 
Reported: 2022-02-27 08:59 PST by Antoine Quint
Modified: 2022-02-27 13:04 PST (History)
11 users (show)

See Also:


Attachments
Patch (4.92 KB, patch)
2022-02-27 09:00 PST, Antoine Quint
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2022-02-27 08:59:46 PST
[svg] fill-opacity should be clamped to the [0,1] range
Comment 1 Antoine Quint 2022-02-27 09:00:17 PST
Created attachment 453342 [details]
Patch
Comment 2 EWS 2022-02-27 12:33:20 PST
Committed r290568 (247846@main): <https://commits.webkit.org/247846@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453342 [details].
Comment 3 Radar WebKit Bug Importer 2022-02-27 12:34:20 PST
<rdar://problem/89531516>
Comment 4 Darin Adler 2022-02-27 12:35:49 PST
Comment on attachment 453342 [details]
Patch

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

> Source/WebCore/rendering/style/SVGRenderStyle.h:285
> +    auto clampedOpacity = clampTo<float>(opacity, 0.f, 1.f);

Should have been able to use std::clamp instead of clampTo<float> here. But I suppose either is OK.