Skip to content

Truly independent web browser

2.6 KB
Raw Blame
<!DOCTYPE html>
<script src="../include.js"></script>
<style>
    #contents {
        display: contents;
        color: rgb(10, 20, 30);
        line-height: 1.5;
        margin: 1px 2px 3px 4px;
        margin-inline-start: 9px;
        writing-mode: vertical-rl;
        direction: rtl;
        background-color: currentcolor;
        background-image: linear-gradient(currentcolor, rgb(40, 50, 60));
    }

    #none {
        display: none;
        color: rgb(70, 80, 90);
        background-color: lab(50 20 30);
        line-height: normal;
        padding: 5px 6px 7px 8px;
    }

    #colors {
        border-top-color: lab(50 20 30);
        border-right-color: lch(60 40 120);
        border-bottom-color: oklab(0.5 0.1 0.2);
        border-left-color: oklch(0.6 0.15 240);
    }

    #pseudo::before {
        content: "hidden";
        display: none;
        color: rgb(100, 110, 120);
        margin: 11px 12px 13px 14px;
    }
</style>
<div id="contents"></div>
<div id="none"></div>
<div id="colors"></div>
<div id="pseudo"></div>
<script>
    test(() => {
        const contentsStyle = getComputedStyle(contents);
        println(`contents display: ${contentsStyle.display}`);
        println(`contents color: ${contentsStyle.color}`);
        println(`contents line-height: ${contentsStyle.lineHeight}`);
        println(`contents margins: ${contentsStyle.marginTop} ${contentsStyle.marginRight} ${contentsStyle.marginBottom} ${contentsStyle.marginLeft}`);
        println(`contents margin shorthand: ${contentsStyle.margin}`);
        println(`contents logical margin: ${contentsStyle.marginInlineStart}`);
        println(`contents background color: ${contentsStyle.backgroundColor}`);
        println(`contents background image: ${contentsStyle.backgroundImage}`);

        const noneStyle = getComputedStyle(none);
        println(`none display: ${noneStyle.display}`);
        println(`none color: ${noneStyle.color}`);
        println(`none background color: ${noneStyle.backgroundColor}`);
        println(`none line-height: ${noneStyle.lineHeight}`);
        println(`none padding shorthand: ${noneStyle.padding}`);

        const colorsStyle = getComputedStyle(colors);
        println(`border colors: ${colorsStyle.borderTopColor} ${colorsStyle.borderRightColor} ${colorsStyle.borderBottomColor} ${colorsStyle.borderLeftColor}`);

        const pseudoStyle = getComputedStyle(pseudo, "::before");
        println(`pseudo display: ${pseudoStyle.display}`);
        println(`pseudo color: ${pseudoStyle.color}`);
        println(`pseudo margin shorthand: ${pseudoStyle.margin}`);
    });
</script>