Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Make numbers keep track of whether they were specified as calc(). #16144

Merged
merged 13 commits into from Mar 27, 2017

style: Test for calc integer expressions.

  • Loading branch information
emilio committed Mar 27, 2017
commit 3ab6a20c85f7a9728df0143c40839fb37275dc71
@@ -11057,6 +11057,12 @@
{}
]
],
"css/calc-number-serialization.html": [
[
"/_mozilla/css/calc-number-serialization.html",
{}
]
],
"css/empty-keyframes.html": [
[
"/_mozilla/css/empty-keyframes.html",
"94dc4aac4c546a74add074be0d3e604c8b196888",
"reftest"
],
"css/calc-number-serialization.html": [
"b9e77c824d0c96e51d51fb8f1e923d3ab67be027",
"testharness"
],
"css/canvas_as_block_element_a.html": [
"668d93da2dab9722998cc7c5785c20e2ab9a1ced",
"reftest"
@@ -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>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.