Skip to content

Truly independent web browser

1.3 KB
Raw Blame
<!DOCTYPE html>
<script src="include.js"></script>
<script src="work-test.js"></script>
<style>
    body { margin: 0; font: 10px/10px SerenitySans; }
    .scenario { display: flow-root; width: 200px; }
    #before { height: 10px; }
    .float { float: left; width: 50px; }
</style>
<div class="scenario" id="scenario"><div id="before"></div><div id="container"><div class="float" id="float">float content</div><span id="beside">text beside the float</span></div></div>
<script>
    layoutTest({
        steps: [
            {
                name: "a float whose containing block moves keeps the layout of its contents",
                mutate: () => {
                    before.style.height = "30px";
                    beside.firstChild.data = "other text beside the float";
                },
                expect: `
                    layout FULL
                      @viewport/block RUN (cache=bypass)
                        BlockContainer<HTML>/block RUN (cache=miss)
                          BlockContainer<DIV>#scenario.scenario/block RUN (cache=miss)
                            BlockContainer<DIV>#float.float/block REUSE SUBTREE
                `,
                check: equal => {
                    equal(float.getBoundingClientRect().top, 30, "float top");
                },
            },
        ],
    });
</script>