Bug 1302470 Part 5: Fix the case where HTML buttons need to generate display item children when doing opaque hit tests. r=mattwoodrow

MozReview-Commit-ID: HwDYsnMJkM8
This commit is contained in:
Brad Werth 2016-11-30 14:35:37 -08:00
Родитель 123cccb1d7
Коммит 40020d1bf8
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -3174,6 +3174,8 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
builder.SetDescendIntoSubdocuments(false);
}
builder.SetHitTestShouldStopAtFirstOpaque(aFlags & ONLY_VISIBLE);
builder.EnterPresShell(aFrame);
aFrame->BuildDisplayListForStackingContext(&builder, aRect, &list);
builder.LeavePresShell(aFrame, nullptr);
@ -3189,7 +3191,6 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
#endif
nsDisplayItem::HitTestState hitTestState;
builder.SetHitTestShouldStopAtFirstOpaque(aFlags & ONLY_VISIBLE);
list.HitTest(&builder, aRect, &hitTestState, &aOutFrames);
list.DeleteAll();
return NS_OK;

Просмотреть файл

@ -119,7 +119,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!isForEventDelivery) {
if (!isForEventDelivery || aBuilder->HitTestShouldStopAtFirstOpaque()) {
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (ShouldClipPaintingToBorderBox()) {