gecko-dev/testing/web-platform/tests/css/css-cascade/revert-val-004.html
Anders Hartvoll Ruud 825ecea277 Bug 1626701 [wpt PR 22615] - Implement basic support for 'revert', a=testonly
Automatic update from web-platform-tests
Implement basic support for 'revert'

CascadeMap now holds the cascaded declarations for the user-agent, user,
and author origins separately. The 'revert' keyword is resolved to
the cascaded value for the target origin before being applied to
ComputedStyle. (This can happen recursively up to the kUserAgent origin.

Note that 'revert' will not yet work to/from surrogates (css-logical
properties), nor in @keyframes.

Bug: 579788
Change-Id: I98b40d596867129e486035f9cd9f20e7b7cbe08e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2130268
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756268}

--

wpt-commits: 4a9b8106d499cce5e63e0a8bb59aec27d47717cf
wpt-pr: 22615
2020-04-09 10:35:34 +00:00

22 lines
604 B
HTML

<!DOCTYPE html>
<title>CSS Cascade: using 'revert' with the 'all' property</title>
<link rel="help" href="https://drafts.csswg.org/css-cascade/#default">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div {
display: inline;
}
.revert {
all: revert;
}
</style>
<div id=div></div>
<script>
test(function() {
let cs = getComputedStyle(div);
assert_equals(cs.display, 'inline');
div.className = 'revert';
assert_equals(cs.display, 'block');
}, 'The revert keyword works with the all property');
</script>