Closed Bug 1557563 Opened 6 years ago Closed 6 years ago

filter function factors should clamp values over 1.0 during animation

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox67 --- wontfix
firefox68 --- wontfix
firefox69 --- fixed

People

(Reporter: ericwilligers, Assigned: violet.bugreport)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36

Steps to reproduce:

Animate CSS filter functions grayscale, invert, opacity or sepia.
Use a bezier timing function that gives progress > 1.

https://jsfiddle.net/ericwilligers/bes3uyxz/

Or proposed WPT css/filter-effects/animation/filter-interpolation-004.html in
https://github.com/web-platform-tests/wpt/pull/17030/

Actual results:

grayscale(1.5)
invert(1.5)
opacity(1.5)
sepia(1.5)

Expected results:

grayscale(1)
invert(1)
opacity(1)
sepia(1)

I was able to reproduce it in Ubuntu 18.04 with latest Nightly 69.0a1 (2019-06-12) (64-bit), Beta 68.0b9 (64-bit) and Release 67.0.2 (64-bit)

Component: Untriaged → DOM: CSS Object Model
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true

So this is because the filter factor computes to a NonNegativeNumber:

https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/servo/components/style/values/specified/effects.rs#85

So we should clamp negatives right, but not values over 1.0. It should compute to something else that clamps to 1.0.

Summary: filter functions should clamp during animation → filter function factors should clamp values over 1.0 during animation

Correctly handle clamping to 1 behavior of grayscale(),
invert(), opacity() and sepia().

Attachment #9073145 - Attachment description: Bug 1557563 - Add computed value BetweenZeroOneNumber → Bug 1557563 - Add computed value ZeroToOneNumber
Assignee: nobody → violet.bugreport
Status: NEW → ASSIGNED
Component: DOM: CSS Object Model → CSS Parsing and Computation
Pushed by violet.bugreport@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0e84cf2872e7 Add computed value ZeroToOneNumber r=emilio,birtles
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17479 for changes under testing/web-platform/tests

I assume this can ride the trains. Please reset status and request uplift if not.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: