Closed Bug 1215977 Opened 9 years ago Closed 9 years ago

make nsLayoutUtils::GetNearestScrollableFrame never return a proper descendant of the passed in frame

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

Details

Attachments

(2 files)

If you are using nsLayoutUtils::GetNearestScrollableFrame to iterate up the frame tree, then returning a proper descendant would put you in an infinite loop.

This happens if you pass "always match root" and pass the root frame. It will return the root scroll frame, which is a child of the root frame.

This specific behaviour was added in http://hg.mozilla.org/mozilla-central/rev/cd8ecc2e1a2e (bug 1105823) so that fixed pos frames (which are children of the root frame, but not descendants of the root scroll frame) would find the root scroll frame APZC for their document. Otherwise they would find nothing, because there is no other scroll frame containing them in the document tree.

I propose to change this as follows: add a new flag that specifies this special behaviour for fixed pos frames, and use it. And then remove the quirk of GetNearestScrollableFrame with root frames.
As I was implementing this I realized we may want to do this for all documents, not just the root document. We can do that in a followup bug if you agree it is something we want.
Attachment #8675454 - Flags: review?(botond)
(In reply to Timothy Nikkel (:tn) from comment #0)
> I propose to change this as follows: add a new flag that specifies this
> special behaviour for fixed pos frames, and use it. And then remove the
> quirk of GetNearestScrollableFrame with root frames.

The patches do this in the reverse order.
Attachment #8675452 - Flags: review?(botond) → review+
Attachment #8675454 - Flags: review?(botond) → review+
(In reply to Timothy Nikkel (:tn) from comment #2)
> As I was implementing this I realized we may want to do this for all
> documents, not just the root document. We can do that in a followup bug if
> you agree it is something we want.

Did you have an opinion on whether we should do this for all documents? Not just the root document?
Flags: needinfo?(botond)
(In reply to Timothy Nikkel (:tn) from comment #5)
> (In reply to Timothy Nikkel (:tn) from comment #2)
> > As I was implementing this I realized we may want to do this for all
> > documents, not just the root document. We can do that in a followup bug if
> > you agree it is something we want.
> 
> Did you have an opinion on whether we should do this for all documents? Not
> just the root document?

I think that's a sensible change.
Flags: needinfo?(botond)
(In reply to Timothy Nikkel (:tn) from comment #2)
> As I was implementing this I realized we may want to do this for all
> documents, not just the root document. We can do that in a followup bug if
> you agree it is something we want.

This is bug 1221870.
https://hg.mozilla.org/mozilla-central/rev/60ed9b57b7d4
https://hg.mozilla.org/mozilla-central/rev/91a6134ea200
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: