Closed
Bug 1399799
Opened 7 years ago
Closed 7 years ago
stylo: Values of amount over 100% are allowed but UAs must clamp the values to 1 for some filter fuctions
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: boris, Assigned: boris)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-github-pull-request
|
Details |
According to the spec [1]-[4], the filter functions, "grayscale", "invert", "opacity", and "sepia", should clamp its value. In other words, values of amount over 100% are allowed but UAs must clamp the values to 1.
However, we don't clamp its value on Servo, so if we do something like this:
div.style.filter = "invert(9.9)";
console.log(div.style.filter); // output is 9.9, ERROR!!!
console.log(getComputedStyle(div).filter); // output is 9.9, ERROR!!!
On Gecko, both specified value and computed value are clamped to 1.0. I guess we clamp it in layout, so we cannot see the problem on the screen. However, if we create an animation:
div.animate([ { filter: "invert(2.4)" },
{ filter: "invert(0.2)" } ],
2000);
When the animation is at 50%, the computed value is 1.1, which means we cannot see an animation for more than 1000ms. The expected interpolation progress should be "from 1.0 to 0.2", instead of "from 2.4 to 0.2".
[1] https://drafts.fxtf.org/filter-effects/#funcdef-filter-grayscale
[2] https://drafts.fxtf.org/filter-effects/#funcdef-filter-invert
[3] https://drafts.fxtf.org/filter-effects/#funcdef-filter-opacity
[4] https://drafts.fxtf.org/filter-effects/#funcdef-filter-sepia
Assignee | ||
Comment 1•7 years ago
|
||
This is a bug, but not sure it should be P3 or P4?
Assignee | ||
Updated•7 years ago
|
Blocks: stylo-smil
Assignee | ||
Updated•7 years ago
|
Status: NEW → ASSIGNED
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
status-firefox57:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•