style: Test for calc integer expressions.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-26 21:56:35 +02:00
parent c7ce2ff483
commit 3ab6a20c85
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 28 additions and 0 deletions

View file

@ -11057,6 +11057,12 @@
{}
]
],
"css/calc-number-serialization.html": [
[
"/_mozilla/css/calc-number-serialization.html",
{}
]
],
"css/empty-keyframes.html": [
[
"/_mozilla/css/empty-keyframes.html",
@ -20700,6 +20706,10 @@
"94dc4aac4c546a74add074be0d3e604c8b196888",
"reftest"
],
"css/calc-number-serialization.html": [
"b9e77c824d0c96e51d51fb8f1e923d3ab67be027",
"testharness"
],
"css/canvas_as_block_element_a.html": [
"668d93da2dab9722998cc7c5785c20e2ab9a1ced",
"reftest"

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS test: Calc expressions with numbers should still serialize as calc()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="test"></div>
<script>
var div = document.querySelector('#test');
test(function() {
div.style.lineHeight = "calc(1)";
assert_equals(div.style.lineHeight, "calc(1)");
}, "calc of an integer expression should be preserved");
test(function() {
div.style.lineHeight = "calc(1 + 3)";
assert_equals(div.style.lineHeight, "calc(4)");
}, "expressions on calc() should be simplified");
</script>