summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-07-18 19:09:05 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-07-18 19:21:07 +0200
commit7979df5512bef6e1a67fbcc390817128fd4e7743 (patch)
tree9b9c63a801f3532f3b9d70d2d6e0eafe28c685f4
parenta4f56a43b634658ee5d6047490fb3a5c24bbee3c (diff)
downloadUXP-7979df5512bef6e1a67fbcc390817128fd4e7743.tar
UXP-7979df5512bef6e1a67fbcc390817128fd4e7743.tar.gz
UXP-7979df5512bef6e1a67fbcc390817128fd4e7743.tar.lz
UXP-7979df5512bef6e1a67fbcc390817128fd4e7743.tar.xz
UXP-7979df5512bef6e1a67fbcc390817128fd4e7743.zip
Revert "Capture delayed events and cancel as necessary."
Tag #1052 (backout). Backed out for creating issues like #1191 and other issue-less problems with e.g. losing the caret from text boxes. Of note: this was also backed out from m-c for similar reasons in Bug 1332433. This fixes #1191. This reverts commit 3424afccaebc71c4acd4fa9eadf519c408c5965b.
-rw-r--r--dom/base/nsGlobalWindow.cpp4
-rw-r--r--layout/base/nsPresShell.cpp12
-rw-r--r--layout/base/nsPresShell.h4
-rw-r--r--toolkit/components/passwordmgr/test/subtst_master_pass.html9
4 files changed, 9 insertions, 20 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index 7895ce613..afaa24f09 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9334,7 +9334,7 @@ nsGlobalWindow::EnterModalState()
topWin->mSuspendedDoc = topDoc;
if (topDoc) {
- topDoc->SuppressEventHandling(nsIDocument::eEvents);
+ topDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
}
nsGlobalWindow* inner = topWin->GetCurrentInnerWindowInternal();
@@ -9371,7 +9371,7 @@ nsGlobalWindow::LeaveModalState()
if (topWin->mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
- topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents,
+ topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == topWin->mSuspendedDoc);
topWin->mSuspendedDoc = nullptr;
}
diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
index dacc6603b..264b52b18 100644
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -8178,9 +8178,6 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
}
}
}
- if (aEvent->mMessage == eKeyDown) {
- mIsLastKeyDownCanceled = aEvent->mFlags.mDefaultPrevented;
- }
break;
}
case eMouseUp:
@@ -8970,9 +8967,6 @@ PresShell::FireOrClearDelayedEvents(bool aFireEvents)
!doc->EventHandlingSuppressed()) {
nsAutoPtr<DelayedEvent> ev(mDelayedEvents[0].forget());
mDelayedEvents.RemoveElementAt(0);
- if (ev->IsKeyPressEvent() && mIsLastKeyDownCanceled) {
- continue;
- }
ev->Dispatch();
}
if (!doc->EventHandlingSuppressed()) {
@@ -9767,12 +9761,6 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
mEvent = keyEvent;
}
-bool
-PresShell::DelayedKeyEvent::IsKeyPressEvent()
-{
- return mEvent->mMessage == eKeyPress;
-}
-
// Start of DEBUG only code
#ifdef DEBUG
diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h
index 10548880a..f20370d73 100644
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -618,7 +618,6 @@ protected:
public:
virtual ~DelayedEvent() { }
virtual void Dispatch() { }
- virtual bool IsKeyPressEvent() { return false; }
};
class DelayedInputEvent : public DelayedEvent
@@ -643,7 +642,6 @@ protected:
{
public:
explicit DelayedKeyEvent(mozilla::WidgetKeyboardEvent* aEvent);
- virtual bool IsKeyPressEvent() override;
};
// Check if aEvent is a mouse event and record the mouse location for later
@@ -954,8 +952,6 @@ protected:
// Whether the widget has received a paint message yet.
bool mHasReceivedPaintMessage : 1;
- bool mIsLastKeyDownCanceled : 1;
-
static bool sDisableNonTestMouseEvents;
};
diff --git a/toolkit/components/passwordmgr/test/subtst_master_pass.html b/toolkit/components/passwordmgr/test/subtst_master_pass.html
index 14174726a..20211866a 100644
--- a/toolkit/components/passwordmgr/test/subtst_master_pass.html
+++ b/toolkit/components/passwordmgr/test/subtst_master_pass.html
@@ -2,6 +2,11 @@
This form triggers a MP and gets filled in.<br>
<form>
Username: <input type="text" id="userfield" name="u"><br>
-Password: <input type="password" id="passfield" name="p"
- oninput="parent.postMessage('filled', '*');"><br>
+Password: <input type="password" id="passfield" name="p"><br>
+<script>
+ // Only notify when we fill in the password field.
+ document.getElementById("passfield").addEventListener("input", function() {
+ parent.postMessage("filled", "*");
+ });
+</script>
</form>