New issue
Advanced search Search tips

Issue 908058 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Yesterday
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

SVG: *-opacity computed value should clamp

Project Member Reported by ericwilligers@chromium.org, Nov 23

Issue description

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.

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 are clamping the computed value to [0,1]

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

 
Interaction between clamping and CSS Animation is investigated in https://github.com/w3c/csswg-drafts/issues/3340
Owner: ericwilligers@chromium.org
Status: Started (was: Untriaged)
https://chromium-review.googlesource.com/c/chromium/src/+/1350369
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7357da2a70de65bf267e8da97dc31e5e96baee20

commit 7357da2a70de65bf267e8da97dc31e5e96baee20
Author: Eric Willigers <ericwilligers@chromium.org>
Date: Tue Nov 27 23:59:10 2018

SVG: clamp *-opacity 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]

BUG= 908058 

Change-Id: I2cb10017c1a42eb991af9ae31c03895847d7f52b
Reviewed-on: https://chromium-review.googlesource.com/c/1350369
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611431}
[modify] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/renderer/core/css/css_properties.json5
[modify] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
[modify] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/renderer/core/css/resolver/style_builder_converter.h
[modify] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/animations/responsive/animations-responsive-opacity.html
[delete] https://crrev.com/b54fb9cc3bbc522b006c38f4a3e88cbda2be1c59/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/fill-opacity-expected.txt
[delete] https://crrev.com/b54fb9cc3bbc522b006c38f4a3e88cbda2be1c59/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/flood-opacity-expected.txt
[delete] https://crrev.com/b54fb9cc3bbc522b006c38f4a3e88cbda2be1c59/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/stop-opacity-expected.txt
[delete] https://crrev.com/b54fb9cc3bbc522b006c38f4a3e88cbda2be1c59/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/stroke-opacity-expected.txt
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/css/filter-effects/parsing/flood-opacity-computed.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/css/filter-effects/parsing/flood-opacity-invalid.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/css/filter-effects/parsing/flood-opacity-valid-expected.txt
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/css/filter-effects/parsing/flood-opacity-valid.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/painting/parsing/fill-opacity-computed.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/painting/parsing/stroke-opacity-computed.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/pservers/parsing/stop-opacity-computed.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/pservers/parsing/stop-opacity-invalid.svg
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/pservers/parsing/stop-opacity-valid-expected.txt
[add] https://crrev.com/7357da2a70de65bf267e8da97dc31e5e96baee20/third_party/blink/web_tests/external/wpt/svg/pservers/parsing/stop-opacity-valid.svg

Comment 5 by ericwilligers@chromium.org, Yesterday (44 hours ago)

Status: Fixed (was: Started)
Chrome 73, Edge, Firefox pass the WPT
https://wpt.fyi/results/svg/painting/parsing/stroke-opacity-computed.svg

Sign in to add a comment