<!DOCTYPE html>
<html>
<head>
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com">
<link rel="help" href="https://drafts.csswg.org/css-box-4/#margin-trim-block">
<meta name="assert" content="If a float is not adjacent to the containing block's edge it should not have its margin trimmed even if it would make it fit at that vertical position"><style>
container {
    display: block;
    border: 1px solid black;
    inline-size: 100px;
    font-family: monospace;
    font-size: 10px;
}
item {
    display: block;
    inline-size: 10px;
    block-size: 80px;
    background-color: green;
    float: right;
}
.inline-end-margin {
    margin-inline-end: 80px;
}
</style>
</head>
<body>
<container>
    <span>The text</span>
    <item></item>
    <item class="inline-end-margin"></item>
    <span>should wrap alongside the float to the right</span>
</container>
</body>
</html>
