Skip to content

Truly independent web browser

4.4 KB
Raw Blame
<!doctype html>
<html id="html">
<script src="../include.js"></script>
<script src="../work-test.js"></script>
<style>
    body { margin: 0; }
    #root { position: relative; width: 100px; }
    svg { display: block; }
</style>
<body id="body">
<div id="root"><svg id="svg" width="100" height="100" style="opacity: 0.5"><rect id="rect" width="100" height="100" fill="url(#g)"/></svg></div>
<svg id="resources" width="0" height="0"><defs id="defs"><linearGradient id="g"><stop id="s0" offset="0" stop-color="red"/><stop id="s1" offset="1" stop-color="red"/></linearGradient></defs></svg>
<script>
displayListTest({
    setup: removeBodyWhitespace,
    steps: [
        {
            name: "quiet SVG with external paint server",
            expect: `
                @canvas RECORD (empty)
                @viewport COPY
            `
        },
        {
            name: "edit external gradient",
            mutate: () => { s0.setAttribute("stop-color", "blue"); },
            expect: `
                @canvas RECORD (empty)
                @viewport ASSEMBLE
                  @viewport/preamble COPY
                  @viewport/scroll-metadata COPY
                  @viewport/background COPY
                  @viewport/border COPY
                  BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE
                  @viewport/foreground COPY
                  BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE
                  BlockContainer<HTML>#html ASSEMBLE
                    BlockContainer<HTML>#html/preamble COPY
                    BlockContainer<HTML>#html/scroll-metadata COPY
                    BlockContainer<HTML>#html/background COPY
                    BlockContainer<HTML>#html/border COPY
                    BlockContainer<BODY>#body/descendants(background-and-borders) ASSEMBLE
                      BlockContainer<BODY>#body/scroll-metadata COPY
                      BlockContainer<BODY>#body/background COPY
                      BlockContainer<BODY>#body/border COPY
                      BlockContainer<DIV>#root/descendants(background-and-borders) ASSEMBLE
                      SVGSVGBox<svg>#resources/descendants(background-and-borders) COPY
                    BlockContainer<BODY>#body/descendants(inline-background-and-borders) ASSEMBLE
                      BlockContainer<DIV>#root/descendants(inline-background-and-borders) ASSEMBLE
                      SVGSVGBox<svg>#resources/descendants(inline-background-and-borders) COPY
                    BlockContainer<HTML>#html/foreground COPY
                    BlockContainer<BODY>#body/descendants(foreground) ASSEMBLE
                      BlockContainer<BODY>#body/foreground COPY
                      BlockContainer<DIV>#root/descendants(foreground) ASSEMBLE
                      SVGSVGBox<svg>#resources/descendants(foreground) COPY
                      BlockContainer<BODY>#body/outline COPY
                      BlockContainer<BODY>#body/overlay COPY
                    BlockContainer<DIV>#root ASSEMBLE
                      BlockContainer<DIV>#root/scroll-metadata COPY
                      BlockContainer<DIV>#root/background COPY
                      BlockContainer<DIV>#root/border COPY
                      SVGSVGBox<svg>#svg/descendants(background-and-borders) ASSEMBLE
                      SVGSVGBox<svg>#svg/descendants(floats) ASSEMBLE
                      SVGSVGBox<svg>#svg/descendants(inline-background-and-borders) ASSEMBLE
                      BlockContainer<DIV>#root/foreground COPY
                      SVGSVGBox<svg>#svg/descendants(foreground) ASSEMBLE
                      BlockContainer<DIV>#root/outline COPY
                      BlockContainer<DIV>#root/overlay COPY
                    SVGSVGBox<svg>#svg ASSEMBLE
                      SVGSVGBox<svg>#svg/preamble RECORD (empty)
                      SVGSVGBox<svg>#svg/scroll-metadata RECORD (empty)
                      SVGSVGBox<svg>#svg/background SKIP
                      SVGSVGBox<svg>#svg/border SKIP
                      SVGSVGBox<svg>#svg/svg RECORD
                        SVGSVGBox<svg>#svg/foreground RECORD (empty)
                        SVGGeometryBox<rect>#rect/svg RECORD
                          SVGGeometryBox<rect>#rect/foreground RECORD
                      SVGSVGBox<svg>#svg/outline SKIP
                    BlockContainer<HTML>#html/outline COPY
                  @viewport/outline COPY
            `
        }
    ]
});
</script>