Closed Bug 1215974 Opened 9 years ago Closed 9 years ago

in nsLayoutUtils::GetNearestScrollableFrame don't skip the root scroll frame if we are asked to always match the root scroll frame even if it doesn't WantAsyncScroll() (and we are also asked to match only async scrollable frames)

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

Details

Attachments

(1 file)

APZ needs a scrollable frame otherwise events might be lost. So if we are asked to always match root and only match async scrollable we need to return the root scroll frame even if it isn't "WantAsyncScroll()" because otherwise we will return null since we have nothing else to return.

APZ is the only user of these two flags.
Seems like this doesn't cause problems because PrepareForSetTargetAPZCNotification in APZCCallbackHelper (the only user) will fall back to the root element, and should almost always already have a displayport before PrepareForSetTargetAPZCNotification is called.
Attached patch patchSplinter Review
Attachment #8675447 - Flags: review?(botond)
Blocks: 1208780
Comment on attachment 8675447 [details] [diff] [review]
patch

Review of attachment 8675447 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsLayoutUtils.cpp
@@ +1909,5 @@
> +        if (!(aFlags & SCROLLABLE_ONLY_ASYNC_SCROLLABLE) ||
> +            scrollableFrame->WantAsyncScroll()) {
> +          return scrollableFrame;
> +        }
> +      }

I would find the following more readable:

if (aFlags & SCROLLABLE_ONLY_ASYNC_SCROLLABLE) {
  if (scrollableFrame->WantAsyncScroll()) {
    return scrollableFrame;
  }
} else {
  ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
  if ((aFlags & SCROLLABLE_INCLUDE_HIDDEN) ||
      ss.mVertical != NS_STYLE_OVERFLOW_HIDDEN ||
      ss.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN) {
    return scrollableFrame;
  }
}
Attachment #8675447 - Flags: review?(botond) → review+
(In reply to Botond Ballo [:botond] from comment #3)
> I would find the following more readable:

I agree, I changed it.
https://hg.mozilla.org/mozilla-central/rev/394230165a48
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: