Bug 191939 - *-opacity computed values should clamp between 0 and 1
Summary: *-opacity computed values should clamp between 0 and 1
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2018-11-24 01:56 PST by Eric Willigers
Modified: 2023-12-06 14:46 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Willigers 2018-11-24 01:56:17 PST
When the specified value is outside the range [0,1], Blink and Safari are currently not clamping the computed value of fill-opacity, flood-opacity, stop-opacity, stroke-opacity.

Edge and Firefox (and spec) are clamping the computed value to [0,1]

https://svgwg.org/svg2-draft/painting.html#FillOpacity
https://svgwg.org/svg2-draft/painting.html#StrokeOpacity
https://drafts.fxtf.org/filter-effects/#FloodOpacityProperty
Computed value:	the specified value converted to a number, clamped to the range [0,1]

https://svgwg.org/svg2-draft/single-page.html#pservers-StopOpacityProperty
Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) must be clamped to this range.

Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=908058

All browsers are clamping the computed value of opacity and shape-image-threshold.
http://jsfiddle.net/ericwilligers/zmgy8735/

(Blink and Safari and Firefox have different behavior when animating: https://github.com/w3c/csswg-drafts/issues/3340 )
Comment 1 Eric Willigers 2019-01-21 03:04:22 PST
Blink (like Edge and Firefox) now clamps the computed value of *-opacity
https://wpt.fyi/results/svg/painting/parsing/stroke-opacity-computed.svg
Comment 2 Radar WebKit Bug Importer 2019-01-22 10:10:49 PST
<rdar://problem/47449828>
Comment 3 Ahmad Saleem 2022-06-20 16:15:59 PDT
Based on attached "JSFiddle" in Comment 01, Safari 15.5 only differs on shape-image-threshold from other browsers (Chrome Canary 105 and Firefox Nightly 103). For all other tests, it is now consistent with other browsers.

I think separate bug can be raised for "shape-image-threshold" issue but I will leave it up to others to decide. Thanks!
Comment 5 Ahmad Saleem 2023-12-06 14:46:42 PST
closing this and raising new for 'shape-image-threshold'. Look into 'See Also'.