er(B);
  await A.requestFullscreen();
  assert_true(isTopLayer(A), 'A is still top layer');
  assert_true(isTopLayer(B), 'B is still top layer');
  assert_equals(document.fullscreenElement, A, 'A is moved back to the top of the top layer stack');
  assert_equals(document.elementFromPoint(10, 10), A, 'A should be topmost');

  await document.exitFullscreen();
  assert_equals(document.fullscreenElement, B, 'B goes back to being the fullscreen element');
  assert_true(isTopLayer(B), 'B is still top layer');
  