# HG changeset patch # User Botond Ballo # Date 1519689812 18000 # Node ID d9910fc2faa6b0054668551c4f892798c5668850 # Parent 8b0ecaa3b27e66f60c5b0dd751ef3fb81b8f20b4 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 diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3545,16 +3545,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(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();