|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<meta charset="utf-8"> |
| 5 | +<title>Compositing and Blending Level 1: getComputedStyle().backgroundBlendMode</title> |
| 6 | +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-background-blend-mode"> |
| 7 | +<meta name="assert" content="background-blend-mode computed value is as specified even when the number of images vary."> |
| 8 | +<script src="/resources/testharness.js"></script> |
| 9 | +<script src="/resources/testharnessreport.js"></script> |
| 10 | +<script src="/css/support/computed-testcommon.js"></script> |
| 11 | +<style> |
| 12 | + #target { |
| 13 | + background-image: linear-gradient(green, green), linear-gradient(green, green), linear-gradient(green, green); |
| 14 | + } |
| 15 | +</style> |
| 16 | +</head> |
| 17 | +<body> |
| 18 | +<div id="target"></div> |
| 19 | +<script> |
| 20 | +// This is testing the case with multiple background images |
| 21 | +// |
| 22 | +// see https://drafts.fxtf.org/compositing-1/#background-blend-mode |
| 23 | +// and https://drafts.csswg.org/css-backgrounds-3/#layering |
| 24 | +// > The lists are matched up from the first value: excess values at the end are not used. |
| 25 | +// and |
| 26 | +// > If a property doesn’t have enough comma-separated values |
| 27 | +// > to match the number of layers, the UA must calculate its used value |
| 28 | +// > by repeating the list of values until there are enough. |
| 29 | +// but in https://drafts.csswg.org/css-values-4/#linked-properties |
| 30 | +// it was decided that |
| 31 | +// > The computed values of the coordinating list properties are not affected by such truncation or repetition. |
| 32 | +// |
| 33 | +// There is a distinction between specified values, used values, and computed values. |
| 34 | + |
| 35 | +// if three images and one value, just send back the specified list. |
| 36 | +test_computed_value("background-blend-mode", "normal"); |
| 37 | +test_computed_value("background-blend-mode", "multiply"); |
| 38 | + |
| 39 | +// if three images and two values, just send back the specified list. |
| 40 | +test_computed_value("background-blend-mode", "normal, luminosity"); |
| 41 | +test_computed_value("background-blend-mode", "screen, overlay"); |
| 42 | +test_computed_value("background-blend-mode", "color, saturation"); |
| 43 | + |
| 44 | +// if three images and three values, just send back the specified list. |
| 45 | +test_computed_value("background-blend-mode", "normal, luminosity, color"); |
| 46 | +test_computed_value("background-blend-mode", "screen, overlay, screen"); |
| 47 | +</script> |
| 48 | +</body> |
| 49 | +</html> |
0 commit comments