Floor right/bottom values of inset()/rect() to make sure that width and height of the rectangle are valid.
Per spec of rect()
, the second (right) and third (bottom) values are
floored by the fourth (left) and second (top) values, respectively. This
is to avoid that they don't cross over the other edge. In our
implementation, we just clamp width and height to make sure they are not
negative. The both ways should be identical.
Note that the spec also mentions another way to handle the similar case
in inset()
, which would like to apply the algorithm mentioned in
"CSS Backgrounds 3 § 4.5 Overlapping Curves rules" to proportionally reduce
the inset effect to 100%. This may cause a different result from
flooring the values. I suspect this is a spec issue:
w3c/csswg-drafts#10870.
Differential Revision: https://phabricator.services.mozilla.com/D222536
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1916646
gecko-commit: 3c43f092dbbf3d5cab1e39e2b450fee1751407e9
gecko-reviewers: dshin