mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
Update web-platform-tests to revision 138d2e938d493a5c8435025162759c2e34b3b1d1
This commit is contained in:
parent
ce37d5ebf2
commit
732399d5d9
1754 changed files with 6528 additions and 3662 deletions
|
@ -41,6 +41,81 @@ test(t => {
|
|||
assert_array_equals(divChild.getAnimations(), [animationChild], 'divChild');
|
||||
}, 'Returns only the animations specific to each parent/child element');
|
||||
|
||||
test(t => {
|
||||
const divParent = createDiv(t);
|
||||
const divChild = createDiv(t);
|
||||
divParent.appendChild(divChild);
|
||||
const divGrandChildA = createDiv(t);
|
||||
const divGrandChildB = createDiv(t);
|
||||
divChild.appendChild(divGrandChildA);
|
||||
divChild.appendChild(divGrandChildB);
|
||||
|
||||
// Trigger the animations in a somewhat random order
|
||||
const animGrandChildB = divGrandChildB.animate(null, 100 * MS_PER_SEC);
|
||||
const animChild = divChild.animate(null, 100 * MS_PER_SEC);
|
||||
const animGrandChildA = divGrandChildA.animate(null, 100 * MS_PER_SEC);
|
||||
|
||||
assert_array_equals(
|
||||
divParent.getAnimations({ subtree: true }),
|
||||
[animGrandChildB, animChild, animGrandChildA],
|
||||
'Returns expected animations from parent'
|
||||
);
|
||||
assert_array_equals(
|
||||
divChild.getAnimations({ subtree: true }),
|
||||
[animGrandChildB, animChild, animGrandChildA],
|
||||
'Returns expected animations from child'
|
||||
);
|
||||
assert_array_equals(
|
||||
divGrandChildA.getAnimations({ subtree: true }),
|
||||
[animGrandChildA],
|
||||
'Returns expected animations from grandchild A'
|
||||
);
|
||||
}, 'Returns animations on descendants when subtree: true is specified');
|
||||
|
||||
test(t => {
|
||||
createStyle(t, {
|
||||
'@keyframes anim': '',
|
||||
[`.pseudo::before`]: 'animation: anim 100s; ' + "content: '';",
|
||||
});
|
||||
const div = createDiv(t);
|
||||
div.classList.add('pseudo');
|
||||
|
||||
assert_equals(
|
||||
div.getAnimations().length,
|
||||
0,
|
||||
'Returns no animations when subtree is false'
|
||||
);
|
||||
assert_equals(
|
||||
div.getAnimations({ subtree: true }).length,
|
||||
1,
|
||||
'Returns one animation when subtree is true'
|
||||
);
|
||||
}, 'Returns animations on pseudo-elements when subtree: true is specified');
|
||||
|
||||
test(t => {
|
||||
const host = createDiv(t);
|
||||
const shadow = host.attachShadow({ mode: 'open' });
|
||||
|
||||
const elem = createDiv(t);
|
||||
shadow.appendChild(elem);
|
||||
|
||||
const elemChild = createDiv(t);
|
||||
elem.appendChild(elemChild);
|
||||
|
||||
elemChild.animate(null, 100 * MS_PER_SEC);
|
||||
|
||||
assert_equals(
|
||||
host.getAnimations({ subtree: true }).length,
|
||||
0,
|
||||
'Returns no animations with subtree:true when called on the host'
|
||||
);
|
||||
assert_equals(
|
||||
elem.getAnimations({ subtree: true }).length,
|
||||
1,
|
||||
'Returns one animation when called on a parent in the shadow tree'
|
||||
);
|
||||
}, 'Does NOT cross shadow-tree boundaries when subtree: true is specified');
|
||||
|
||||
test(t => {
|
||||
const foreignElement
|
||||
= document.createElementNS('http://example.org/test', 'test');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue