1 Tests layout of absolutely positioned modal dialogs.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
7 showModal() should center in the viewport.
8 PASS dialog.getBoundingClientRect().top is centeredTop
10 The computed top and bottom of a centered dialog should still have position auto.
11 PASS window.getComputedStyle(dialog).top is "auto"
12 PASS window.getComputedStyle(dialog).bottom is "auto"
14 Dialog should be recentered if showModal() is called after close().
15 PASS dialog.getBoundingClientRect().top is centeredTop
17 Dialog should not recenter on relayout.
18 PASS dialog.getBoundingClientRect().top is expectedTop
20 A tall dialog should be positioned at the top of the viewport.
21 PASS dialog.getBoundingClientRect().top is 0
23 The dialog should be centered regardless of the presence of a horizontal scrollbar.
24 PASS dialog.getBoundingClientRect().top is centeredTop
26 Centering should work when dialog is inside positioned containers.
27 PASS dialog.getBoundingClientRect().top is centeredTop
28 PASS dialog.getBoundingClientRect().top is centeredTop
30 A centered dialog's position should survive becoming display:none temporarily.
31 PASS dialog.getBoundingClientRect().top is expectedTop
33 Dialog should lose centering when removed from the document.
34 PASS dialog.getBoundingClientRect().top is relativeContainer.getBoundingClientRect().top
36 Dialog's specified position should survive after close() and showModal().
37 PASS dialog.getBoundingClientRect().top is expectedTop
39 Dialog should be recentered if showModal() is called after removing 'open'.
40 PASS dialog.getBoundingClientRect().top is centeredTop
42 Dialog should not be centered if showModal() was called when an ancestor had display 'none'.
43 PASS dialog.getBoundingClientRect().top is document.body.getBoundingClientRect().bottom
45 A dialog with specified 'top' should be positioned as usual
46 PASS dialog.getBoundingClientRect().top + window.scrollY is offset
48 A dialog with specified 'bottom' should be positioned as usual
49 PASS dialog.getBoundingClientRect().bottom + window.scrollY is window.innerHeight - offset
50 PASS successfullyParsed is true