Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-box/margin-trim/computed-margin-values/grid-block-start.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com">
<meta name="assert" content="Grid items with trimmed block start margins should be reflected in computed style">
<style>
grid {
display: grid;
width: min-content;
border: 1px solid black;
grid-template-columns: auto auto;
margin-trim: block-start;
}
item {
display: block;
width: 50px;
height: 50px;
background-color: green;
}
.locked-location {
grid-row: 1;
grid-column: 2;
}
item:nth-child(1) {
margin-block-start: 50%;
}
item:nth-child(2) {
margin-block-start: -30px;
}
item:nth-child(3) {
margin-block-start: 10px;
}
item:nth-child(4) {
margin-block-start: 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 class="locked-location" data-expected-margin-top="0"></item>
<item data-expected-margin-top="0"></item>
<item data-expected-margin-top="10"></item>
<item data-expected-margin-top="10"></item>
</grid>
</div>
</body>
</html>