Backed out changeset 2f74f8f2ed19 (bug 1689816) for causing reftest failures on skip-ink-multiline-position.html.

This commit is contained in:
Marian-Vasile Laza
2022-09-26 23:24:03 +03:00
parent b7f6194b8d
commit 338fc0a451
72 changed files with 1250 additions and 339 deletions

View File

@@ -3961,24 +3961,38 @@ void PresShell::ClearMouseCaptureOnView(nsView* aView) {
}
void PresShell::ClearMouseCapture() {
nsIContent* capturingContent = GetCapturingContent();
if (!capturingContent) {
AllowMouseCapture(false);
return;
}
ReleaseCapturingContent();
AllowMouseCapture(false);
}
void PresShell::ClearMouseCapture(nsIFrame* aFrame) {
MOZ_ASSERT(aFrame);
MOZ_ASSERT(
aFrame && aFrame->GetParent() &&
aFrame->GetParent()->Type() == LayoutFrameType::Deck,
"This function should only be called with a child frame of <deck>");
nsIContent* capturingContent = GetCapturingContent();
if (!capturingContent) {
AllowMouseCapture(false);
return;
}
nsIFrame* capturingFrame = capturingContent->GetPrimaryFrame();
const bool shouldClear =
!capturingFrame ||
nsLayoutUtils::IsAncestorFrameCrossDocInProcess(aFrame, capturingFrame);
if (shouldClear) {
ClearMouseCapture();
if (!capturingFrame) {
ReleaseCapturingContent();
AllowMouseCapture(false);
return;
}
if (nsLayoutUtils::IsAncestorFrameCrossDocInProcess(aFrame, capturingFrame)) {
ReleaseCapturingContent();
AllowMouseCapture(false);
}
}