Bug 1597489 - Fix uses of nsIDocShellTreeItem in nsTitleBarFrame::HandleEvent. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D59288

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tetsuharu OHZEKI 2020-01-09 09:27:02 +00:00
Родитель 502fbbd9f7
Коммит 826da87e18
1 изменённых файлов: 8 добавлений и 11 удалений

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

@ -65,19 +65,16 @@ nsresult nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
case eMouseDown: {
if (aEvent->AsMouseEvent()->mButton == MouseButton::eLeft) {
// titlebar has no effect in non-chrome shells
nsCOMPtr<nsIDocShellTreeItem> dsti = aPresContext->GetDocShell();
if (dsti) {
if (dsti->ItemType() == nsIDocShellTreeItem::typeChrome) {
// we're tracking.
mTrackingMouseMove = true;
if (aPresContext->IsChrome()) {
// we're tracking.
mTrackingMouseMove = true;
// start capture.
PresShell::SetCapturingContent(GetContent(),
CaptureFlags::IgnoreAllowedState);
// start capture.
PresShell::SetCapturingContent(GetContent(),
CaptureFlags::IgnoreAllowedState);
// remember current mouse coordinates.
mLastPoint = aEvent->mRefPoint;
}
// remember current mouse coordinates.
mLastPoint = aEvent->mRefPoint;
}
*aEventStatus = nsEventStatus_eConsumeNoDefault;