Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/calc-mix-invalid.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="sam@webkit.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script>
<script>
function test_invalid_number(value) {
test_invalid_value('scale', value);
}
function test_invalid_length_percentage(value) {
test_invalid_value('text-indent', value);
}
function test_invalid_length(value) {
test_invalid_value('transform-origin-z', value);
}
// Syntax checking
test_invalid_number('calc-mix()');
test_invalid_number('calc-mix( )');
test_invalid_number('calc-mix(,)');
test_invalid_number('calc-mix(1, )');
test_invalid_number('calc-mix(0,1,)');
test_invalid_number('calc-mix(0,, 0)');
test_invalid_number('calc-mix(1 50, 3)');
test_invalid_number('calc-mix(1 150%, 3)');
test_invalid_number('calc-mix(1 -50%, 3)');
// Type checking
test_invalid_number('calc-mix(1px 50%, 3px 50%)');
test_invalid_number('calc-mix(1deg 50%, 3turn 50%)');
test_invalid_number('calc-mix(1% 50%, 3 50%)');
test_invalid_length('calc-mix(1 50%, 3 50%)');
test_invalid_length('calc-mix(1deg 50%, 3turn 50%)');
test_invalid_length('calc-mix(1% 50%, 3 50%)');
test_invalid_length_percentage('calc-mix(1 50%, 3 50%)');
test_invalid_length_percentage('calc-mix(1deg 50%, 3turn 50%)');
test_invalid_length_percentage('calc-mix(1% 50%, 3 50%)');
</script>