fune/testing/web-platform/tests/css/css-env/supports-script.tentative.html
Daniel Libby 037de114ac Bug 1733672 [wpt PR 31065] - Add viewport segments CSS environment variables, a=testonly
Automatic update from web-platform-tests
Add viewport segments CSS environment variables

The viewport-segment-* set of environment variables are two dimensional,
i.e. you need an x and y values in order to access them. This change
adds support for such environment variables to CSS parser, style
resolution and the StyleEnvironmentVariables class. The variable values
are stored separately in a two dimensional vector, and new methods that
explicitly operate on two dimensional variables (via an explicit enum)
have been introduced.

Additionally, this CL converts the previous fold-* variables to the new
viewport-segment variables with the indexed syntax.

Bug: 1039051
Change-Id: Id520ee47f4c9bd79bc47ee1693c80750f2a8779b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3195791
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Auto-Submit: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#928050}

--

wpt-commits: 25db855bf307d50924dc30cd2557784930d75248
wpt-pr: 31065
2021-10-06 08:04:06 +00:00

22 lines
797 B
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://drafts.csswg.org/css-env-1/">
<title>Test that CSS env vars work with CSS.supports</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
test(() => {
assert_true(CSS.supports("background: env(test)"));
assert_true(CSS.supports("background", "env(test)"));
assert_true(CSS.supports("background", "env(test, 10px)"));
assert_true(CSS.supports("background", "foobar(env(test))"));
assert_false(CSS.supports("background", "env()"));
assert_true(CSS.supports("background", "env(test, )"));
assert_true(CSS.supports("background", "env(test,)"));
});
</script>
</body>
</html>