Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/computed-grid-column.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Grid Layout Test: row/column is complex calc()</title>
<style>
.grid {
position: relative;
display: inline-grid;
grid-template-columns: 100px 150px;
grid-template-rows: 150px 100px;
}
.firstRowSecondColumn {
grid-row: calc(2 * sign(100em - 1px) - 1);
grid-column: calc(3 - sign(100em - 1px));
}
.someHugeValue {
/* Just check that we don't crash. */
grid-row: calc(1e100);
grid-column: calc(-1e100);
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div class="grid">
<div class="firstRowSecondColumn" id="target">X XX X</div>
<div class="someHugeValue">X XX X</div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(target).gridRow, '1');
assert_equals(getComputedStyle(target).gridColumn, '2');
});
</script>