fune/testing/web-platform/tests/css/css-env/at-supports.tentative.html
Becca Hughes 2835aeb010 Bug 1470933 [wpt PR 11658] - Reland "[CSS Env Vars] Add some WPT tests", a=testonly
Automatic update from web-platform-testsReland "[CSS Env Vars] Add some WPT tests"

This is a reland of 981a543f9e743001a6e492a006873de3a5953747

This adds a bugfix that adds a DetachFromParent method that
we call in StyleEngine. This stops the global environment
variables instance holding a reference to the document
one after the document has been disposed.

Original change's description:
> [CSS Env Vars] Add some WPT tests
>
> Adds some WPT tests to test env() with @supports as well
> as fallback values.
>
> BUG=825890
>
> Change-Id: I071f5c2582f8056fe39b4a50ab62140d579c577d
> Reviewed-on: https://chromium-review.googlesource.com/1111023
> Reviewed-by: Rune Lillesveen <futhark@chromium.org>
> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
> Commit-Queue: Becca Hughes <beccahughes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#569852}

Bug: 825890
Change-Id: If828b977d62145fb1ea9bb710a48d76307a054d5
Reviewed-on: https://chromium-review.googlesource.com/1113877
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570117}

--

wpt-commits: 775bb3b7bf1e28c58d8381422e6755c3f6936b46
wpt-pr: 11658
2018-07-11 07:59:14 +01:00

22 lines
636 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 @support</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@supports (background-color: env(test)) {
body { background-color: rgb(0, 128, 0); }
}
</style>
</head>
<body>
<script>
test(() => {
const style = window.getComputedStyle(document.body);
assert_equals(style.getPropertyValue("background-color"), "rgb(0, 128, 0)");
});
</script>
</body>
</html>