Skip to content

Truly independent web browser

8.0 KB
Raw Blame
<!doctype html>
<html id="html">
<script src="../include.js"></script>
<script src="../work-test.js"></script>
<style>
    body { margin: 0; font: 16px/20px monospace; }
    #root { position: relative; z-index: 0; width: 200px; }
    #scroller { position: relative; z-index: 0; overflow: scroll; height: 60px; }
    #content { height: 300px; }
</style>
<body id="body">
<div id="root"><div id="scroller"><div id="content">scrollable</div></div></div>
<script>
displayListTest({
    setup: removeBodyWhitespace,
    steps: [
        {
            name: "quiet without overlays",
            expect: `
                @canvas RECORD (empty)
                @viewport COPY
            `
        },
        {
            name: "enable overlays",
            paintOverlay: true,
            expect: `
                @canvas RECORD (empty)
                @viewport RECORD
                  @viewport/preamble RECORD (empty)
                  @viewport/scroll-metadata RECORD
                  @viewport/background SKIP
                  @viewport/border SKIP
                  BlockContainer<HTML>#html/descendants(background-and-borders) RECORD
                  @viewport/foreground RECORD (empty)
                  BlockContainer<HTML>#html/descendants(foreground) RECORD
                  BlockContainer<HTML>#html RECORD
                    BlockContainer<HTML>#html/preamble RECORD (empty)
                    BlockContainer<HTML>#html/scroll-metadata RECORD
                    BlockContainer<HTML>#html/background RECORD (empty)
                    BlockContainer<HTML>#html/border SKIP
                    BlockContainer<BODY>#body/descendants(background-and-borders) RECORD
                      BlockContainer<BODY>#body/scroll-metadata RECORD
                      BlockContainer<BODY>#body/background SKIP
                      BlockContainer<BODY>#body/border SKIP
                      BlockContainer<DIV>#root/descendants(background-and-borders) RECORD
                    BlockContainer<HTML>#html/foreground RECORD (empty)
                    BlockContainer<BODY>#body/descendants(foreground) RECORD
                      BlockContainer<BODY>#body/foreground RECORD (empty)
                      BlockContainer<DIV>#root/descendants(foreground) RECORD
                      BlockContainer<BODY>#body/outline SKIP
                      BlockContainer<BODY>#body/overlay SKIP
                    BlockContainer<DIV>#root RECORD
                      BlockContainer<DIV>#root/preamble RECORD (empty)
                      BlockContainer<DIV>#root/scroll-metadata RECORD
                      BlockContainer<DIV>#root/background SKIP
                      BlockContainer<DIV>#root/border SKIP
                      BlockContainer<DIV>#scroller/descendants(background-and-borders) RECORD
                      BlockContainer<DIV>#root/foreground RECORD (empty)
                      BlockContainer<DIV>#scroller/descendants(foreground) RECORD
                      BlockContainer<DIV>#scroller RECORD
                        BlockContainer<DIV>#scroller/preamble RECORD (empty)
                        BlockContainer<DIV>#scroller/scroll-metadata RECORD
                        BlockContainer<DIV>#scroller/background SKIP
                        BlockContainer<DIV>#scroller/border SKIP
                        BlockContainer<DIV>#content/descendants(background-and-borders) RECORD
                          BlockContainer<DIV>#content/scroll-metadata RECORD
                          BlockContainer<DIV>#content/background SKIP
                          BlockContainer<DIV>#content/border SKIP
                        BlockContainer<DIV>#scroller/foreground RECORD (empty)
                        BlockContainer<DIV>#content/descendants(foreground) RECORD
                          BlockContainer<DIV>#content/foreground RECORD
                          BlockContainer<DIV>#content/outline SKIP
                          BlockContainer<DIV>#content/overlay SKIP
                        BlockContainer<DIV>#scroller/outline SKIP
                        BlockContainer<DIV>#scroller/overlay RECORD
                      BlockContainer<DIV>#root/outline SKIP
                      BlockContainer<DIV>#root/overlay SKIP
                    BlockContainer<HTML>#html/outline SKIP
                    BlockContainer<HTML>#html/overlay SKIP
                  @viewport/outline SKIP
                  @viewport/overlay RECORD (empty)
            `
        },
        {
            name: "disable overlays",
            expect: `
                @canvas RECORD (empty)
                @viewport RECORD
                  @viewport/preamble RECORD (empty)
                  @viewport/scroll-metadata RECORD
                  @viewport/background SKIP
                  @viewport/border SKIP
                  BlockContainer<HTML>#html/descendants(background-and-borders) RECORD
                  @viewport/foreground RECORD (empty)
                  BlockContainer<HTML>#html/descendants(foreground) RECORD
                  BlockContainer<HTML>#html RECORD
                    BlockContainer<HTML>#html/preamble RECORD (empty)
                    BlockContainer<HTML>#html/scroll-metadata RECORD
                    BlockContainer<HTML>#html/background RECORD (empty)
                    BlockContainer<HTML>#html/border SKIP
                    BlockContainer<BODY>#body/descendants(background-and-borders) RECORD
                      BlockContainer<BODY>#body/scroll-metadata RECORD
                      BlockContainer<BODY>#body/background SKIP
                      BlockContainer<BODY>#body/border SKIP
                      BlockContainer<DIV>#root/descendants(background-and-borders) RECORD
                    BlockContainer<HTML>#html/foreground RECORD (empty)
                    BlockContainer<BODY>#body/descendants(foreground) RECORD
                      BlockContainer<BODY>#body/foreground RECORD (empty)
                      BlockContainer<DIV>#root/descendants(foreground) RECORD
                      BlockContainer<BODY>#body/outline SKIP
                      BlockContainer<BODY>#body/overlay SKIP
                    BlockContainer<DIV>#root RECORD
                      BlockContainer<DIV>#root/preamble RECORD (empty)
                      BlockContainer<DIV>#root/scroll-metadata RECORD
                      BlockContainer<DIV>#root/background SKIP
                      BlockContainer<DIV>#root/border SKIP
                      BlockContainer<DIV>#scroller/descendants(background-and-borders) RECORD
                      BlockContainer<DIV>#root/foreground RECORD (empty)
                      BlockContainer<DIV>#scroller/descendants(foreground) RECORD
                      BlockContainer<DIV>#scroller RECORD
                        BlockContainer<DIV>#scroller/preamble RECORD (empty)
                        BlockContainer<DIV>#scroller/scroll-metadata RECORD
                        BlockContainer<DIV>#scroller/background SKIP
                        BlockContainer<DIV>#scroller/border SKIP
                        BlockContainer<DIV>#content/descendants(background-and-borders) RECORD
                          BlockContainer<DIV>#content/scroll-metadata RECORD
                          BlockContainer<DIV>#content/background SKIP
                          BlockContainer<DIV>#content/border SKIP
                        BlockContainer<DIV>#scroller/foreground RECORD (empty)
                        BlockContainer<DIV>#content/descendants(foreground) RECORD
                          BlockContainer<DIV>#content/foreground RECORD
                          BlockContainer<DIV>#content/outline SKIP
                          BlockContainer<DIV>#content/overlay SKIP
                        BlockContainer<DIV>#scroller/outline SKIP
                      BlockContainer<DIV>#root/outline SKIP
                    BlockContainer<HTML>#html/outline SKIP
                  @viewport/outline SKIP
            `
        },
        {
            name: "quiet without overlays again",
            expect: `
                @canvas RECORD (empty)
                @viewport COPY
            `
        }
    ]
});
</script>