Bug 1307555 - Create a hit test info item for a scroll frame's scrolled frame that's not clipped to the displayport. r=mstange
MozReview-Commit-ID: 5MJg4zqxSAk
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3576,16 +3576,32 @@ ScrollFrameHelper::BuildDisplayList(nsDi
if (mWillBuildScrollableLayer && aBuilder->IsPaintingToWindow()) {
asrSetter.EnterScrollFrame(sf);
}
if (mIsScrollableLayerInRootContainer) {
aBuilder->SetActiveScrolledRootForRootScrollframe(aBuilder->CurrentActiveScrolledRoot());
}
+ if (mWillBuildScrollableLayer) {
+ // Create a hit test info item for the scrolled content that's not
+ // clipped to the displayport. This ensures that within the bounds
+ // of the scroll frame, the scrolled content is always hit, even
+ // if we are checkerboarding.
+ if (aBuilder->BuildCompositorHitTestInfo()) {
+ CompositorHitTestInfo info = mScrolledFrame->GetCompositorHitTestInfo(aBuilder);
+ if (info != CompositorHitTestInfo::eInvisibleToHitTest) {
+ nsDisplayCompositorHitTestInfo* hitInfo =
+ MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1);
+ aBuilder->SetCompositorHitTestInfo(hitInfo);
+ scrolledContent.BorderBackground()->AppendToTop(hitInfo);
+ }
+ }
+ }
+
{
// Clip our contents to the unsnapped scrolled rect. This makes sure that
// we don't have display items over the subpixel seam at the edge of the
// scrolled area.
DisplayListClipState::AutoSaveRestore scrolledRectClipState(aBuilder);
nsRect scrolledRectClip =
GetUnsnappedScrolledRectInternal(mScrolledFrame->GetScrollableOverflowRect(),
mScrollPort.Size()) + mScrolledFrame->GetPosition();