wpt / css / filter-effects / parsing / filter-parsing-valid.html

Status: FAIL | Duration: 122ms | Subtests: 67/87 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
e.style['filter'] = "none" should set the property valuePASS
e.style['filter'] = "blur(100px)" should set the property valuePASS
e.style['filter'] = "blur(0)" should set the property valuePASS
e.style['filter'] = "blur()" should set the property valuePASS
e.style['filter'] = "blur(calc(100px))" should set the property valuePASS
e.style['filter'] = "blur(calc(100px + (50px * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "brightness(0)" should set the property valuePASS
e.style['filter'] = "brightness(300%)" should set the property valuePASS
e.style['filter'] = "brightness()" should set the property valuePASS
e.style['filter'] = "brightness(calc(3))" should set the property valuePASS
e.style['filter'] = "brightness(calc(300%))" should set the property valuePASS
e.style['filter'] = "brightness(calc(-10))" should set the property valuePASS
e.style['filter'] = "brightness(calc(-10%))" should set the property valuePASS
e.style['filter'] = "brightness(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "brightness(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "contrast(0)" should set the property valuePASS
e.style['filter'] = "contrast(300%)" should set the property valuePASS
e.style['filter'] = "contrast()" should set the property valuePASS
e.style['filter'] = "contrast(calc(3))" should set the property valuePASS
e.style['filter'] = "contrast(calc(300%))" should set the property valuePASS
e.style['filter'] = "contrast(calc(-10))" should set the property valuePASS
e.style['filter'] = "contrast(calc(-10%))" should set the property valuePASS
e.style['filter'] = "contrast(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "contrast(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "drop-shadow(1px 2px)" should set the property valuePASS
e.style['filter'] = "drop-shadow(1px 2px 3px)" should set the property valuePASS
e.style['filter'] = "drop-shadow(0 0 0)" should set the property valuePASS
e.style['filter'] = "drop-shadow(rgb(4, 5, 6) 1px 2px)" should set the property valuePASS
e.style['filter'] = "drop-shadow(1px 2px rgb(4, 5, 6))" should set the property valuePASS
e.style['filter'] = "drop-shadow(rgba(4, 5, 6, 0.75) 1px 2px 3px)" should set the property valuePASS
e.style['filter'] = "drop-shadow(rgb(4, 5, 6) calc(1px) 2px 0px)" should set the property valuePASS
e.style['filter'] = "drop-shadow(rgb(4, 5, 6) calc(10px + (5px * sign(2cqw - 10px))) 2px 0px)" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "grayscale(0)" should set the property valuePASS
e.style['filter'] = "grayscale(300%)" should set the property valuePASS
e.style['filter'] = "grayscale(calc(101% * sign(1em - 1px)))" should set the property valuePASS
e.style['filter'] = "grayscale()" should set the property valuePASS
e.style['filter'] = "grayscale(calc(3))" should set the property valuePASS
e.style['filter'] = "grayscale(calc(300%))" should set the property valuePASS
e.style['filter'] = "grayscale(calc(-10))" should set the property valuePASS
e.style['filter'] = "grayscale(calc(-10%))" should set the property valuePASS
e.style['filter'] = "grayscale(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "grayscale(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "hue-rotate(90deg)" should set the property valuePASS
e.style['filter'] = "hue-rotate(0)" should set the property valuePASS
e.style['filter'] = "hue-rotate()" should set the property valuePASS
e.style['filter'] = "hue-rotate(calc(90deg))" should set the property valuePASS
e.style['filter'] = "hue-rotate(calc(90deg + (45deg * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "invert(0)" should set the property valuePASS
e.style['filter'] = "invert(300%)" should set the property valuePASS
e.style['filter'] = "invert()" should set the property valuePASS
e.style['filter'] = "invert(calc(3))" should set the property valuePASS
e.style['filter'] = "invert(calc(300%))" should set the property valuePASS
e.style['filter'] = "invert(calc(-10))" should set the property valuePASS
e.style['filter'] = "invert(calc(-10%))" should set the property valuePASS
e.style['filter'] = "invert(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "invert(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "opacity(0)" should set the property valuePASS
e.style['filter'] = "opacity(300%)" should set the property valuePASS
e.style['filter'] = "opacity(2)" should set the property valuePASS
e.style['filter'] = "opacity()" should set the property valuePASS
e.style['filter'] = "opacity(calc(3))" should set the property valuePASS
e.style['filter'] = "opacity(calc(300%))" should set the property valuePASS
e.style['filter'] = "opacity(calc(-10))" should set the property valuePASS
e.style['filter'] = "opacity(calc(-10%))" should set the property valuePASS
e.style['filter'] = "opacity(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "opacity(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "saturate(0)" should set the property valuePASS
e.style['filter'] = "saturate(300%)" should set the property valuePASS
e.style['filter'] = "saturate()" should set the property valuePASS
e.style['filter'] = "saturate(calc(3))" should set the property valuePASS
e.style['filter'] = "saturate(calc(300%))" should set the property valuePASS
e.style['filter'] = "saturate(calc(-10))" should set the property valuePASS
e.style['filter'] = "saturate(calc(-10%))" should set the property valuePASS
e.style['filter'] = "saturate(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "saturate(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "sepia(0)" should set the property valuePASS
e.style['filter'] = "sepia(300%)" should set the property valuePASS
e.style['filter'] = "sepia()" should set the property valuePASS
e.style['filter'] = "sepia(calc(3))" should set the property valuePASS
e.style['filter'] = "sepia(calc(300%))" should set the property valuePASS
e.style['filter'] = "sepia(calc(-10))" should set the property valuePASS
e.style['filter'] = "sepia(calc(-10%))" should set the property valuePASS
e.style['filter'] = "sepia(calc(10 + (5 * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "sepia(calc(100% + (50% * sign(2cqw - 10px))))" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "url(picture.svg#f)" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "url(\"https://www.example.com/picture.svg#f\")" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['filter'] = "blur(10px) url(\"picture.svg#f\") contrast(20) brightness(30)" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""

/css/filter-effects/parsing/filter-parsing-valid.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 1: parsing filter with valid values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterProperty">
<meta name="assert" content="filter supports the full grammar 'none | <filter-function-list>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<style>
  #container {
    container-type: inline-size;
    width: 100px;
  }
  #target {
    color: lime;
  }
</style>
<div id=container>
<div id="target"></div>
</div>
<script>
test_valid_value("filter", "none");

test_valid_value("filter", "blur(100px)");
test_valid_value("filter", "blur(0)", "blur(0px)");
test_valid_value("filter", "blur()", ["blur()", "blur(0px)"]);
test_valid_value("filter", "blur(calc(100px))");
test_valid_value("filter", "blur(calc(100px + (50px * sign(2cqw - 10px))))");

test_valid_value("filter", "brightness(0)");
test_valid_value("filter", "brightness(300%)");
test_valid_value("filter", "brightness()", ["brightness()", "brightness(1)"]);
test_valid_value("filter", "brightness(calc(3))");
test_valid_value("filter", "brightness(calc(300%))");
test_valid_value("filter", "brightness(calc(-10))");
test_valid_value("filter", "brightness(calc(-10%))");
test_valid_value("filter", "brightness(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "brightness(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "contrast(0)");
test_valid_value("filter", "contrast(300%)");
test_valid_value("filter", "contrast()", ["contrast()", "contrast(1)"]);
test_valid_value("filter", "contrast(calc(3))");
test_valid_value("filter", "contrast(calc(300%))");
test_valid_value("filter", "contrast(calc(-10))");
test_valid_value("filter", "contrast(calc(-10%))");
test_valid_value("filter", "contrast(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "contrast(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "drop-shadow(1px 2px)");
test_valid_value("filter", "drop-shadow(1px 2px 3px)");
test_valid_value("filter", "drop-shadow(0 0 0)", "drop-shadow(0px 0px 0px)");
// https://github.com/w3c/fxtf-drafts/issues/240
test_valid_value("filter", "drop-shadow(rgb(4, 5, 6) 1px 2px)");
test_valid_value("filter", "drop-shadow(1px 2px rgb(4, 5, 6))", "drop-shadow(rgb(4, 5, 6) 1px 2px)");
test_valid_value("filter", "drop-shadow(rgba(4, 5, 6, 0.75) 1px 2px 3px)");
test_valid_value("filter", "drop-shadow(rgb(4, 5, 6) calc(1px) 2px 0px)");
test_valid_value("filter", "drop-shadow(rgb(4, 5, 6) calc(10px + (5px * sign(2cqw - 10px))) 2px 0px)");

test_valid_value("filter", "grayscale(0)");
test_valid_value("filter", "grayscale(300%)", "grayscale(100%)");
test_valid_value("filter", "grayscale(calc(101% * sign(1em - 1px)))");
test_valid_value("filter", "grayscale()", ["grayscale()", "grayscale(1)"]);
test_valid_value("filter", "grayscale(calc(3))");
test_valid_value("filter", "grayscale(calc(300%))");
test_valid_value("filter", "grayscale(calc(-10))");
test_valid_value("filter", "grayscale(calc(-10%))");
test_valid_value("filter", "grayscale(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "grayscale(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "hue-rotate(90deg)");
test_valid_value("filter", "hue-rotate(0)", "hue-rotate(0deg)"); // https://github.com/w3c/fxtf-drafts/issues/228
test_valid_value("filter", "hue-rotate()", ["hue-rotate()", "hue-rotate(0deg)"]);
test_valid_value("filter", "hue-rotate(calc(90deg))");
test_valid_value("filter", "hue-rotate(calc(90deg + (45deg * sign(2cqw - 10px))))");

test_valid_value("filter", "invert(0)");
test_valid_value("filter", "invert(300%)", "invert(100%)");
test_valid_value("filter", "invert()", ["invert()", "invert(1)"]);
test_valid_value("filter", "invert(calc(3))");
test_valid_value("filter", "invert(calc(300%))");
test_valid_value("filter", "invert(calc(-10))");
test_valid_value("filter", "invert(calc(-10%))");
test_valid_value("filter", "invert(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "invert(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "opacity(0)");
test_valid_value("filter", "opacity(300%)", "opacity(100%)");
test_valid_value("filter", "opacity(2)", "opacity(1)");
test_valid_value("filter", "opacity()", ["opacity()", "opacity(1)"]);
test_valid_value("filter", "opacity(calc(3))");
test_valid_value("filter", "opacity(calc(300%))");
test_valid_value("filter", "opacity(calc(-10))");
test_valid_value("filter", "opacity(calc(-10%))");
test_valid_value("filter", "opacity(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "opacity(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "saturate(0)");
test_valid_value("filter", "saturate(300%)");
test_valid_value("filter", "saturate()", ["saturate()", "saturate(1)"]);
test_valid_value("filter", "saturate(calc(3))");
test_valid_value("filter", "saturate(calc(300%))");
test_valid_value("filter", "saturate(calc(-10))");
test_valid_value("filter", "saturate(calc(-10%))");
test_valid_value("filter", "saturate(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "saturate(calc(100% + (50% * sign(2cqw - 10px))))");

test_valid_value("filter", "sepia(0)");
test_valid_value("filter", "sepia(300%)", "sepia(100%)");
test_valid_value("filter", "sepia()", ["sepia()", "sepia(1)"]);
test_valid_value("filter", "sepia(calc(3))");
test_valid_value("filter", "sepia(calc(300%))");
test_valid_value("filter", "sepia(calc(-10))");
test_valid_value("filter", "sepia(calc(-10%))");
test_valid_value("filter", "sepia(calc(10 + (5 * sign(2cqw - 10px))))");
test_valid_value("filter", "sepia(calc(100% + (50% * sign(2cqw - 10px))))");

// Edge serializes url(...) without quotes. Blink/WebKit and Firefox use quotes.
test_valid_value("filter", "url(picture.svg#f)", ['url("picture.svg#f")', 'url(picture.svg#f)']);

test_valid_value("filter", 'url("https://www.example.com/picture.svg#f")',
  ['url("https://www.example.com/picture.svg#f")', 'url(https://www.example.com/picture.svg#f)']);

test_valid_value("filter", 'blur(10px) url("picture.svg#f") contrast(20) brightness(30)',
  ['blur(10px) url("picture.svg#f") contrast(20) brightness(30)', 'blur(10px) url(picture.svg#f) contrast(20) brightness(30)']);
</script>
</body>
</html>