зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1531213 - Round to nearest integer per spec for calc() r=dholbert
Rounding to the nearest integer rounds in the direction of +inf when the fractional portion is 0.5. eg: -1.5 -> -1, 1.5 -> 2 Spec: https://www.w3.org/TR/css-values-4/#css-round-to-the-nearest-integer WPT test: https://wpt.fyi/results/css/css-values/calc-z-index-fractions-001.html 1 WPT subtest newly passes. Differential Revision: https://phabricator.services.mozilla.com/D182745
This commit is contained in:
Родитель
928aff7def
Коммит
c50b872101
|
@ -931,7 +931,7 @@ impl CalcNode {
|
|||
input: &mut Parser<'i, 't>,
|
||||
function: MathFunction,
|
||||
) -> Result<CSSInteger, ParseError<'i>> {
|
||||
Self::parse_number(context, input, function).map(|n| n.round() as CSSInteger)
|
||||
Self::parse_number(context, input, function).map(|n| (n + 0.5).floor() as CSSInteger)
|
||||
}
|
||||
|
||||
/// Convenience parsing function for `<length> | <percentage>`.
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[calc-z-index-fractions-001.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[testing z-index: calc(-3 / 2)]
|
||||
expected: FAIL
|
Загрузка…
Ссылка в новой задаче