+++ This bug was initially created as a clone of Bug #369370 +++ When content is resizes itself, it can become smaller than where the current viewed is scrolled to. When this happens, the view should scroll itself back to a sensible location, so the user isn't looking at a blank window. See bug 369370 for some more background on the problem, with testcases. That bug fixed a special case of this problem, when viewing a autozoomed image and zooming in/out, but it's a more general problem. I also noted in comment 16 there that part of the problem is that there are no scrollbars being shown, which makes the problem worse. At least with scrollbars the user might notice that the view is scrolled to a strange place and correct it.
This is specific to nsImageDocument right? I.e. it only happens when the primary content document is a stand-alone image.
The second testcase (from 369370) seems to show this too, with normal HTML/JS content. The instructions there are a little vague. Do this: 1) Open attachment 258065 [details]. Click its "click this" link, which opens a window. 2) In the window, click the green area once to expand it. 3) Resize the window to, say, 1/2 the original width. 4) Scroll over to the right some. There are no scroll bars (!), so hit the right-arrow key a few times. 5) Click the green area once more to shrink it. 6) Observe that window appears blank. I suppose this is a partially a problem due to not having scrollbars for UI feedback, and partially a problem with content shrinking itself.
On latest Aurora (20131003004003), using the STR from Comment 2, at step 4 the scroll bars are missing, and at step 6 the green area is visible (the window doesn't appear blank). Dropping the qawanted keyword. Please re-add it if there is anything else we can help with.