idth / 2;
        const expectedTopOffset = Math.max(iframeHeight / 2 - dialogRect.height / 2, 0);

        if (isDefaultSize) {
          assert_approx_equals(dialogRect.left, expectedLeftOffset, 1/60);
          assert_approx_equals(dialogRect.top, expectedTopOffset, 1/60);
        } else {
          assert_equals(dialogRect.left, expectedLeftOffset);
          assert_equals(dialogRect.top, expectedTopOffset);
        }
      });
      document.body.appendChild(iframe);
    }, writingMode + (containerWrit