Skip to content

Truly independent web browser

Compositor: Clamp the result of each CSS filter function

sideshowbarker90acb05ff4f0
diff --git a/Services/Compositor/SkiaUtils.cpp b/Services/Compositor/SkiaUtils.cpp
index 8aa440f926a..a4ee16e5b9b 100644
--- a/Services/Compositor/SkiaUtils.cpp
+++ b/Services/Compositor/SkiaUtils.cpp
@@ -247,6 +247,11 @@ sk_sp<SkImageFilter> SkiaFilterReader::filter()
sk_sp<SkColorFilter> color_filter;
// Matrices are taken from https://drafts.fxtf.org/filter-effects-1/#FilterPrimitiveRepresentation
+ // https://drafts.csswg.org/filter-effects-1/#FilterPrimitivesOverviewIntro
+ // The RGBA result from each filter primitive will be clamped into the allowable ranges for colors and opacity
+ // values.
+ // NB: Each function is equivalent to a filter primitive of its own, so its result is clamped before the next
+ // function applies to it.
switch (type) {
case ColorFilterType::Grayscale: {
float matrix[20] = {
@@ -268,7 +273,7 @@ sk_sp<SkImageFilter> SkiaFilterReader::filter()
0, 0, amount, 0, 0,
0, 0, 0, 1, 0
};
- color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kNo);
+ color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kYes);
break;
}
case ColorFilterType::Contrast: {
@@ -279,7 +284,7 @@ sk_sp<SkImageFilter> SkiaFilterReader::filter()
0, 0, amount, 0, intercept,
0, 0, 0, 1, 0
};
- color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kNo);
+ color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kYes);
break;
}
case ColorFilterType::Invert: {
@@ -322,7 +327,7 @@ sk_sp<SkImageFilter> SkiaFilterReader::filter()
0.213f - 0.213f * amount, 0.715f - 0.715f * amount, 0.072f + 0.928f * amount, 0, 0,
0, 0, 0, 1, 0
};
- color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kNo);
+ color_filter = SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kYes);
break;
}
default:
@@ -383,7 +388,7 @@ sk_sp<SkImageFilter> SkiaFilterReader::filter()
a20, a21, a22, 0, 0,
0, 0, 0, 1, 0
};
- return SkImageFilters::ColorFilter(SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kNo), input);
+ return SkImageFilters::ColorFilter(SkColorFilters::Matrix(matrix, SkColorFilters::Clamp::kYes), input);
}
case FilterOperationType::Image: {
auto const& frame = m_image_frame(value<u64>());
diff --git a/Tests/LibWeb/Ref/expected/css-filter-functions-clamped-between-steps-ref.html b/Tests/LibWeb/Ref/expected/css-filter-functions-clamped-between-steps-ref.html
new file mode 100644
index 00000000000..8eecc87d37d
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/css-filter-functions-clamped-between-steps-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+ body {
+ margin: 0;
+ }
+ div {
+ float: left;
+ width: 50px;
+ height: 50px;
+ margin-right: 10px;
+ }
+</style>
+<div style="background: rgb(128, 128, 128)"></div>
+<div style="background: rgb(191, 73, 64)"></div>
+<div style="background: rgb(128, 0, 0)"></div>
+<div style="background: rgb(255, 134, 0)"></div>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/backdrop-filters-saturate-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/backdrop-filters-saturate-ref.html
new file mode 100644
index 00000000000..f3407f34490
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/backdrop-filters-saturate-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>CSS Backdrop Filters Animation: Saturate</title>
+<link rel="author" href="mailto:[email protected]">
+
+
+<style>
+ .square {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ top: 100px;
+ left: 100px;
+ background: #f4fbff;
+ filter: saturate(2500%);
+ }
+ .filt {
+ position: absolute;
+ width: 200px;
+ height: 200px;
+ top: 50px;
+ left: 50px;
+ background: white;
+ filter: saturate(2500%);
+ }
+ .greenbox {
+ position: absolute;
+ width: 50px;
+ height: 50px;
+ top: 125px;
+ left: 125px;
+ background: green;
+ }
+</style>
+<p>You should see a light-blue rectangle with a green box. Neither cyan nor white.</p>
+<div class="filt"></div>
+<div class="square"></div>
+<div class="greenbox"></div>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-001-ref.html
new file mode 100644
index 00000000000..1be00e8bba7
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-001-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: green;
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a green box.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-002-ref.html
new file mode 100644
index 00000000000..51ee9548d53
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-002-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: #808080;
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a gray box and no red.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-003-ref.html
new file mode 100644
index 00000000000..6ce55c0f12e
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-contrast-003-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: black;
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a black box and no dark red.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-saturate-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-saturate-001-ref.html
new file mode 100644
index 00000000000..4f654f9c554
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filter-saturate-001-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter Test: Reference for Saturate short hand</title>
+ <link rel="author" title="Akihiro Oyamada" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background: #EDEDED;
+ }
+
+ </style>
+</head>
+<body>
+ <p>You should see a gray rectangle.</p>
+
+ <div></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-001.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-001.html
new file mode 100644
index 00000000000..dd160bc65dc
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-001.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+
+ div.brightness_hundred {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(0, 255, 0);
+ }
+ </style>
+</head>
+<body>
+ <p>You should see green rectangle.</p>
+ <div class="brightness_hundred"></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-002.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-002.html
new file mode 100644
index 00000000000..808cc5f0d49
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-002.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+
+ div.brightness_zero {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(0, 0, 0);
+ }
+ </style>
+</head>
+<body>
+ <p>You should see a black rectangle and no red.</p>
+ <div class="brightness_zero"></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-003.html b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-003.html
new file mode 100644
index 00000000000..a587321538e
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/filter-effects/filters-ref-brightness-003.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <style type="text/css">
+
+ div.brightness_noset {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(0, 255, 0);
+ }
+ </style>
+</head>
+<body>
+ <p>You should see green rectangle.</p>
+ <div class="brightness_noset"></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/css-filter-functions-clamped-between-steps.html b/Tests/LibWeb/Ref/input/css-filter-functions-clamped-between-steps.html
new file mode 100644
index 00000000000..e772cea6b26
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/css-filter-functions-clamped-between-steps.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<link rel="match" href="../expected/css-filter-functions-clamped-between-steps-ref.html" />
+<meta name="fuzzy" content="maxDifference=0-4;totalPixels=0-10000" />
+<style>
+ body {
+ margin: 0;
+ }
+ div {
+ float: left;
+ width: 50px;
+ height: 50px;
+ margin-right: 10px;
+ }
+</style>
+<!-- Each filter function's result is clamped to the range of a color before the next function applies to it. -->
+<div style="background: rgb(128, 128, 128); filter: brightness(3) brightness(0.5)"></div>
+<div style="background: rgb(200, 100, 50); filter: contrast(4) contrast(0.5)"></div>
+<div style="background: rgb(200, 100, 50); filter: saturate(8) brightness(0.5)"></div>
+<div style="background: #ffcd22; filter: hue-rotate(-20deg) saturate(10)"></div>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/backdrop-filters-saturate.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/backdrop-filters-saturate.html
new file mode 100644
index 00000000000..d9d604910ef
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/backdrop-filters-saturate.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>CSS Backdrop Filters Animation: Saturate</title>
+<link rel="author" href="mailto:[email protected]">
+<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
+<link rel="match" href="../../../../expected/wpt-import/css/filter-effects/backdrop-filters-saturate-ref.html">
+<meta name="fuzzy" content="maxDifference=0-5; totalPixels=0-37500" />
+<style>
+ .square {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ top: 100px;
+ left: 100px;
+ background: #f4fbff;
+ }
+ .filt {
+ backdrop-filter: saturate(2500%);
+ position: absolute;
+ width: 200px;
+ height: 200px;
+ top: 50px;
+ left: 50px;
+ }
+ .greenbox {
+ position: absolute;
+ width: 50px;
+ height: 50px;
+ top: 75px;
+ left: 75px;
+ background: green;
+ }
+</style>
+<p>You should see a light-blue rectangle with a green box. Neither cyan nor white.</p>
+<div class="square"></div>
+<div class="filt">
+ <div class="greenbox"></div>
+</div>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-001.html
new file mode 100644
index 00000000000..005c7fba503
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-001.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter contrast: CSS contrast filter shotrhand</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-contrast">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filter-contrast-001-ref.html">
+ <meta name="assert" content="CSS contrast filter will apply a component transfer to the div element to adjust the
+ contrast of the colors. Since contrast is 100%, it will leave unchanged.">
+ <style type="text/css">
+
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: green;
+ filter: contrast(100%);
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a green box.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-002.html
new file mode 100644
index 00000000000..5755f315675
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-002.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter contrast: CSS contrast filter shotrhand</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-contrast">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filter-contrast-002-ref.html">
+ <meta name="assert" content="CSS contrast filter will apply a component transfer to the div element to adjust the
+ contrast of the colors. Since contrast is 0%, it must be the completely gray.">
+ <style type="text/css">
+
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: red;
+ filter: contrast(0%);
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a gray box and no red.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-003.html
new file mode 100644
index 00000000000..8b031a0df1e
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-contrast-003.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter contrast: Test for CSS contrast filter shorthand</title>
+ <link rel="author" title="Takeshi Kurosawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-contrast">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filter-contrast-003-ref.html">
+ <meta name="assert" content="CSS contrast filter will apply a component transfer to the div element to adjust the
+ contrast of the colors. Since contrast is 200%, it will be less contrast.">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background-color: #3f0000;
+ filter: contrast(200%);
+ }
+ </style>
+</head>
+<body>
+ <p>The test passes if there is a black box and no dark red.</p>
+
+ <div></div>
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-saturate-001-test.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-saturate-001-test.html
new file mode 100644
index 00000000000..7bf41c72ca5
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filter-saturate-001-test.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter Test: Test for Saturate short hand</title>
+ <link rel="author" title="Akihiro Oyamada" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-saturate">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#saturateEquivalent">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filter-saturate-001-ref.html">
+ <meta name="assert" content="the test passes if you see gray box.">
+ <style type="text/css">
+ div {
+ width: 200px;
+ height: 200px;
+ background: yellow;
+ filter: saturate( 0% );
+ }
+
+ </style>
+</head>
+<body>
+ <p>You should see a gray rectangle.</p>
+
+ <div></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-001.html
new file mode 100644
index 00000000000..00565d22d82
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-001.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Writing Modes Test: drop-shadow offset test</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="reviewer" title="Rebecca Hauck" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-brightness">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filters-ref-brightness-001.html">
+ <meta name="assert" content="This test verifies that the brightness shorthand works. Green rectangle must shown,
+ when brightness set to 100%.">
+ <style type="text/css">
+
+ div.brightness_hundred {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(0, 255, 0);
+ filter: brightness(100%);
+ }
+ </style>
+</head>
+<body>
+ <p>You should see green rectangle.</p>
+ <div class="brightness_hundred"></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-002.html
new file mode 100644
index 00000000000..6083869d82b
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-002.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Writing Modes Test: drop-shadow offset test</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-brightness">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filters-ref-brightness-002.html">
+ <meta name="assert" content="This test verifies that the brightness shorthand works. Black rectangle must shown,
+ when brightness set 0%.">
+ <style type="text/css">
+ div.brightness_zero {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(255, 0, 0);
+ filter: brightness(0%);
+ }
+ </style>
+</head>
+<body>
+ <p>You should see a black rectangle and no red.</p>
+ <div class="brightness_zero"></div>
+
+</body>
+</html>
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-003.html
new file mode 100644
index 00000000000..f982c6ddcbd
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/wpt-import/css/filter-effects/filters-test-brightness-003.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Filter Effects: brightness(...) without argument</title>
+ <link rel="author" title="Jun Ichikawa" href="mailto:[email protected]">
+ <link rel="reviewer" title="Dirk Schulze" href="mailto:[email protected]">
+ <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty">
+ <link rel="help" href="https://www.w3.org/TR/filter-effects-1/#funcdef-filter-brightness">
+ <link rel="match" href="../../../../expected/wpt-import/css/filter-effects/filters-ref-brightness-003.html">
+ <meta name="assert" content="This test verifies that the brightness shorthand works. Green rectangle must shown,
+ when brightness is not set.">
+ <style type="text/css">
+
+ div.brightness_noset {
+ width: 200px;
+ height: 200px;
+ background-color: rgb(0, 255, 0);
+ filter: brightness(0);
+ filter: brightness();
+ }
+ </style>
+</head>
+<body>
+ <p>You should see green rectangle.</p>
+ <div class="brightness_noset"></div>
+
+</body>
+</html>