Closed Bug 985992 Opened 8 years ago Closed 7 years ago

Calculate root composition bounds correctly when the widget bounds are incorrect

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1043644

People

(Reporter: botond, Assigned: tnikkel)

References

Details

Currently, when calculating the composition bounds for the root content document's root scroll frame, we use the widget bounds if the frame's view has a widget, otherwise we use the view bounds.

In https://bugzilla.mozilla.org/show_bug.cgi?id=983208#c11 we discovered that the view bounds aren't what we want in some cases, so we went back to using the bounds of the nearest widget on Android.

However, as explained in the same comment, this is more of a band-aid as the bounds of the nearest widget aren't necessarily correct in all cases. This bug is to track a proper fix for this.
The first thing I wanted to do was understand why the view bounds were not what I expected them to be.
Blocks: 988882
I think my expectation of what the view bounds were was just incorrect. After we resize the rootframe in PresShell::ResizeReflow we do SyncFrameViewPropertiesAfterReflow and the root view gets the same size as the root frame.

The docshell and nsIContentViewer (nsDocumentViewer) bounds do still stay unaffected, so I think they would be the correct analog for widget bounds when the document doesn't have a widget.

I thought I had suggested using these bounds to Botond at one point, but them being the same as the frame bounds. Which is not what I just observed. Botond, do you remember at all?
(In reply to Timothy Nikkel (:tn) from comment #2)
> I think my expectation of what the view bounds were was just incorrect.
> After we resize the rootframe in PresShell::ResizeReflow we do
> SyncFrameViewPropertiesAfterReflow and the root view gets the same size as
> the root frame.
> 
> The docshell and nsIContentViewer (nsDocumentViewer) bounds do still stay
> unaffected, so I think they would be the correct analog for widget bounds
> when the document doesn't have a widget.
> 
> I thought I had suggested using these bounds to Botond at one point, but
> them being the same as the frame bounds. Which is not what I just observed.
> Botond, do you remember at all?

I remember trying the doc shell bounds. I don't remember ever working with nsIContentViewer or nsDocumentViewer.
And the docshell bounds didn't "work" or were the same as the frame bounds?
(In reply to Timothy Nikkel (:tn) from comment #4)
> And the docshell bounds didn't "work" or were the same as the frame bounds?

I think they were the same as something else that wasn't what we wanted (possibly the frame bounds). I'm not sure in what other sense they might not have "worked".
After talking to Botond on irc I remembered that we were looking at the different bounds for bug 988882, where we wanted the size minus the toolbar, but we were getting the screen size. Which is what we would expect. So the nsIContentViewer bounds are what we want.
If there's something that needs doing here now is probably a good time to finish it off.
Assignee: nobody → tnikkel
Bug 1043644 does comment 2. So this is done now.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1043644
You need to log in before you can comment on or make changes to this bug.