Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="author" href="mailto:sammy.gill@apple.com">
<meta name="assert" content="trimmed inline-end margins for grid items should be reflected in computed style">
<style>
grid {
display: grid;
grid-template-columns: repeat(2, auto);
outline: 1px solid black;
margin-trim: inline-end;
}
item {
display: block;
height: 50px;
}
.locked-position {
grid-row: 2;
grid-column: 2;
}
item:nth-child(1) {
background-color: aqua;
margin-inline-end: 10px;
}
item:nth-child(2) {
background-color: blueviolet;
margin-inline-end: 30%;
}
item:nth-child(3) {
background-color: blue;
margin-inline-end: -30px;
}
item:nth-child(4) {
background-color: coral;
margin-inline-end: 10px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
</head>
<body onload="checkLayout('grid > item')">
<div id="target">
<grid>
<item data-expected-margin-right="10"></item>
<item data-expected-margin-right="0"></item>
<item class="locked-position" data-expected-margin-right="0"></item>
<item data-expected-margin-right="10"></item>
</grid>
</div>
</body>
</html>