mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision c5dd38e18824f16f48b0c1703f43ff33359d9947
This commit is contained in:
parent
74e3a4b0c5
commit
ec9472572a
129 changed files with 2532 additions and 324 deletions
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org">
|
||||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<popup id=p1 anchor=b1><p>This is popup #1</p>
|
||||
<button id=b2 onclick='p2.show()'>Popup 2</button>
|
||||
<button id=b4 onclick='p4.show()'>Popup 4</button>
|
||||
</popup>
|
||||
<popup id=p2 anchor=b2><p>This is popup #2</p>
|
||||
<button id=b3 onclick='p3.show()'>Popup 3</button>
|
||||
</popup>
|
||||
<popup id=p3 anchor=b3><p>This is popup #3</p></popup>
|
||||
<popup id=p4 anchor=b4><p>This is popup #4</p></popup>
|
||||
|
||||
<button id=b1 onclick='p1.show()'>Popup 1</button>
|
||||
|
||||
<script>
|
||||
const popups = [p1, p2, p3, p4];
|
||||
|
||||
function assertState(...states) {
|
||||
assert_equals(popups.length,states.length);
|
||||
for(let i=0;i<popups.length;++i) {
|
||||
assert_equals(popups[i].open,states[i],`Popup #${i+1} incorrect state`);
|
||||
}
|
||||
}
|
||||
test(function() {
|
||||
assertState(false,false,false,false);
|
||||
p1.show();
|
||||
assertState(true,false,false,false);
|
||||
p2.show();
|
||||
assertState(true,true,false,false);
|
||||
p3.show();
|
||||
assertState(true,true,true,false);
|
||||
// P4 is a sibling of P2, so showing it should
|
||||
// close P2 and P3.
|
||||
p4.show();
|
||||
assertState(true,false,false,true);
|
||||
// P2 should close P4 now.
|
||||
p2.show();
|
||||
assertState(true,true,false,false);
|
||||
// Hiding P1 should hide all.
|
||||
p1.hide();
|
||||
assertState(false,false,false,false);
|
||||
}, "popup stacking behavior")
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#p1 { top:350px; }
|
||||
#p2 { top:350px; left:200px; }
|
||||
#p3 { top:500px; }
|
||||
#p4 { top:500px;left:200px; }
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue