<!DOCTYPE html>
<html style="outline: 5px solid red;">
<head>
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com">
<title>margin-trim: block-container-float-block-end-deeply-nested</title>
<link rel="help" href="https://drafts.csswg.org/css-box-4/#margin-trim-block">
<meta name="assert" content="Deeply nested float with many offsets in between should trim block end margin up to content">
</head>
<body>
<div style="border: 10px solid black; padding: 20px;">
    <div style="height: 50px; background-color: green"></div>
    <div style="border: 25px solid purple">
        <div style="width: 50px; height: 50px; background-color: blue; float: right; margin-block-end: 200px;"></div>
        <div style="width: 50px; height: 50px; background-color: red;"></div>
    </div>
    <div style="border: 30px solid gray;">
        <div style="height: 50px; background-color: yellow;"></div>
        <div style="border: 5px solid orange;">
            <div style="height: 25px; background-color: green"></div>
            <div style="border: 15px solid purple;">
                <div style="background-color: pink; height: 10px;"></div>
                <div style="height: 25px; background-color: red"></div>   
                <div style="width: 50px; height: 50px; background-color: orange; float: right;"></div>
                <div style="width: 50px; height: 25px; background-color: blue"></div> 
            </div> 
        </div>
    </div>
</div>
</body>
</html>
