Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 9 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/calc-complex-unresolved-serialize.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Values and Units Test: Serialization of non-simplified calc() expressions</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/serialize-testcommon.js"></script>
<style>
#target { font-size: 20px; }
</style>
<div>
<div id="target"></div>
</div>
<script>
function test_serialization(value, specified, computed) {
test_specified_serialization("orphans", value, specified);
test_computed_serialization("orphans", value, computed);
}
test_serialization("calc(pow(2, sign(1em - 18px)))", "calc(pow(2, sign(1em - 18px)))", "2");
test_serialization("calc(pow(sign(1em - 18px), 2))", "calc(pow(sign(1em - 18px), 2))", "1");
test_serialization("calc(pow(sign(1em - 18px), sign(1em - 18px)))", "calc(pow(sign(1em - 18px), sign(1em - 18px)))", "1");
test_serialization("calc(pow(2, sibling-index())", "calc(pow(2, sibling-index()))", "2");
test_serialization("calc(pow(sibling-index(), 2)", "calc(pow(sibling-index(), 2))", "1");
test_serialization("calc(pow(sibling-index(), sibling-index())", "calc(pow(sibling-index(), sibling-index()))", "1");
</script>