Open Bug 1683810 Opened 4 years ago Updated 2 years ago

The display size in MVM for popup window is often never updated

Categories

(Core :: Layout, defect)

defect

Tracking

()

People

(Reporter: hiro, Unassigned)

References

(Blocks 1 open bug)

Details

From bug 1683612 comment 12;

(In reply to Timothy Nikkel (:tnikkel) from comment #11)

Does the display size change later to a non-zero value? I would hope it does.

If the case of the scrollbar appears properly, the answer is yes, the display size was initially (0, 0) and it becomes a proper size. But in the case of the problem case, it seems the display size will never be resized correctly as far as I can tell.

Presumably this may be a problem when we want desktop zoom feature in popup window.

Summary: The display size in MVM for popup window is often never updates → The display size in MVM for popup window is often never updated

I did track down this a bit. So what happens when the popup window size is changed is; nsDocumentViewer::SetBoundsWithFlags gets called, then we run though this code path, thus we call nsIFrame::InvalidateFrame.

But unfortunately, to set the display size in MVM it doesn't work, we need to call PresShell::ResizeReflow instead. But ResizeReflow checks UsesMobileViewportSizing(), which kind of makes sense because we don't need to trigger auto-shrink machinery on desktop. Maybe we can directly change MobileViewportManager::mDisplaySize from nsDocumentViewer::SetBoundsWithFlags? It looks awkward though.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #1)

I did track down this a bit. So what happens when the popup window size is changed is; nsDocumentViewer::SetBoundsWithFlags gets called, then we run though this code path, thus we call nsIFrame::InvalidateFrame.

But unfortunately, to set the display size in MVM it doesn't work, we need to call PresShell::ResizeReflow instead. But ResizeReflow checks UsesMobileViewportSizing(), which kind of makes sense because we don't need to trigger auto-shrink machinery on desktop. Maybe we can directly change MobileViewportManager::mDisplaySize from nsDocumentViewer::SetBoundsWithFlags? It looks awkward though.

The SetWindowDimensions call in nsDocumentViewer::SetBoundsWithFlags should result in ResizeReflow getting called eventually, no?

No, because in the case the size is same, it's this condition.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)

No, because in the case the size is same, it's this condition.

Then here.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)

No, because in the case the size is same, it's this condition.

Then here.

Okay, so the view has the right size but the presshell does not. Should we inform the MVM of the (potential) size change in nsDocumentViewer::SetBoundsWithFlags where we call InvalidateFrame so that it can update?

You need to log in before you can comment on or make changes to this bug.