mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4'
This commit is contained in:
parent
4401622eb1
commit
b77ad115f6
16832 changed files with 270819 additions and 87621 deletions
|
@ -0,0 +1,74 @@
|
|||
<!doctype html>
|
||||
<title>container-name invalidation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-name">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/cq-testcommon.js"></script>
|
||||
<style>
|
||||
div {
|
||||
color: black;
|
||||
}
|
||||
#outer {
|
||||
container-name: c1;
|
||||
container-type: inline-size;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#inner {
|
||||
container-name: c2;
|
||||
container-type: inline-size;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#intermediate {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
@container c1 size(width: 250px) {
|
||||
#child {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id=outer>
|
||||
<div id=intermediate>
|
||||
<div id=inner>
|
||||
<div id=child>Test</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
setup(() => assert_implements_container_queries());
|
||||
|
||||
test(function(t) {
|
||||
t.add_cleanup(() => { outer.style = ''; });
|
||||
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 0, 0)');
|
||||
|
||||
outer.style.width = '250px';
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 128, 0)');
|
||||
|
||||
outer.style.width = '251px';
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 0, 0)');
|
||||
}, 'Changing a named container invalidates relevant descendants');
|
||||
|
||||
test(function(t) {
|
||||
t.add_cleanup(() => {
|
||||
outer.style = '';
|
||||
intermediate.style = '';
|
||||
});
|
||||
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 0, 0)');
|
||||
|
||||
// #intermediate becomes the new container.
|
||||
intermediate.style = 'container-name:c1; container-type:inline-size';
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 128, 0)');
|
||||
|
||||
// #outer becomes the container again.
|
||||
intermediate.style = '';
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 0, 0)');
|
||||
|
||||
outer.style.width = '250px';
|
||||
assert_equals(getComputedStyle(child).color, 'rgb(0, 128, 0)');
|
||||
}, 'Changing container-name invalidates relevant descendants');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue