Content-Length: 397073 | pFad | http://github.com/mozilla/gecko-dev/commit/60e3004339abd38513f807981dfd3050f6b37d79

63 Bug 1858833 [wpt PR 42518] - fix #42496. better getCS with background… · mozilla/gecko-dev@60e3004 · GitHub
Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 60e3004

Browse files
karlcowmoz-wptsync-bot
authored andcommittedOct 26, 2023
Bug 1858833 [wpt PR 42518] - fix #42496. better getCS with backgroundBlendMode, a=testonly
Automatic update from web-platform-tests Better getComputedStyle() with backgroundBlendMode This was discussed in w3c/csswg-drafts#7164 (comment). > Don't specifically say the computed value is same as specified value, > it's implied. can be louder in the spec so it's obvious The specification for CSS values 4 makes it more explicit https://drafts.csswg.org/css-values-4/#linked-properties > The computed values of the coordinating list properties are > not affected by such truncation or repetition. So this patch add comments in the code to make sure this is understood and add a test to cover the case of multiple images. Fixes #42496. -- wpt-commits: 8668841ddcc733bd15678f07dd0ff4570ff4444e wpt-pr: 42518
1 parent 16ea1e1 commit 60e3004

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
 
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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>

‎testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
test_computed_value("background-blend-mode", "color");
3030
test_computed_value("background-blend-mode", "luminosity");
3131

32+
// Per spec, excess values should not be used,
33+
// BUT the computed style should be similar to the specified values.
34+
// see https://drafts.fxtf.org/compositing-1/#background-blend-mode
35+
// and https://drafts.csswg.org/css-backgrounds-3/#layering
36+
// > The lists are matched up from the first value: excess values at the end are not used.
37+
// but in https://drafts.csswg.org/css-values-4/#linked-properties
38+
// it was decided that
39+
// > The computed values of the coordinating list properties are not affected by such truncation or repetition.
40+
//
41+
// There is a distinction between specified values, used values, and computed values.
42+
3243
test_computed_value("background-blend-mode", "normal, luminosity");
3344
test_computed_value("background-blend-mode", "screen, overlay");
3445
test_computed_value("background-blend-mode", "color, saturation");

0 commit comments

Comments
 (0)
Failed to load comments.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mozilla/gecko-dev/commit/60e3004339abd38513f807981dfd3050f6b37d79

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy