chromium/third_party/blink/web_tests/http/tests/csspaint/invalidation-background-image.html

<!DOCTYPE html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/run-after-layout-and-paint.js"></script>
<script src="resources/test-runner-invalidation-logging.js"></script>
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: red;

        flex-basis: 200px;
        --str:foo;
        --fiftypx: 50px;
    }
</style>
</head>
<p>This tests the invalidation behaviour of the paint callback.</p>
<p>See the devtools console for additional test output.</p>
<script>
CSS.registerProperty({name: '--length-inherited', syntax: '<length>', inherits: true, initialValue: '0px'});
CSS.registerProperty({name: '--length-non-inherited', syntax: '<length>', inherits: false, initialValue: '0px'});

// TODO(ikilpatrick): Should test shorthands.
testRunnerInvalidationLogging('background-image', [
    { property: 'max-height', prevValue: '', value: '160px' },
    { property: 'max-height', prevValue: '100px', value: '160px' },
    { property: 'max-height', prevValue: '100px', value: 'calc(50px + 50px)', noInvalidation: true },
    { property: 'max-height', prevValue: '100px', value: 'calc(50px + var(--fiftypx))', noInvalidation: true },
    { property: 'flex-basis', prevValue: '', value: '100px' },
    { property: 'flex-basis', prevValue: '100px', value: '' },
    { property: 'flex-basis', prevValue: '', value: '200px', noInvalidation: true },
    { property: 'flex-basis', prevValue: '200px', value: '', noInvalidation: true },
    { property: 'color', prevValue: '', value: 'red' },
    { property: 'color', prevValue: '#F00', value: 'red', noInvalidation: true },
    { property: 'border-top-color', prevValue: '', value: 'blue' },
    { property: 'border-top-color', prevValue: 'rgb(0,0,255)', value: 'blue', noInvalidation: true },
    { property: '--foo', prevValue: '', value: 'foo' },
    { property: '--foo', prevValue: 'foo', value: 'var(--str)', noInvalidation: true},
    { property: '--str', prevValue: '', value: 'bar'},
    { property: '--str', prevValue: '', value: 'foo', noInvalidation: true },
    { property: '--length-inherited', prevValue: '', value: '10px'},
    { property: '--length-non-inherited', prevValue: '', value: '20px'},
    { property: '-webkit-border-radius', prevValue: '', value: '25px'},
    { property: '-webkit-border-radius', invalidationProperty: 'border-radius', prevValue: '', value: '25px' },
    { property: 'border-radius', invalidationProperty: '-webkit-border-radius', prevValue: '25px', value: '' },
    { property: '-webkit-border-radius', prevValue: '100px', value: 'calc(50px + 50px)', noInvalidation: true },
    { property: 'margin-inline-start', invalidationProperty: 'margin-left', prevValue: 'calc(50px + 50px)', value: '100px', noInvalidation: true },
]);
</script>