mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-02-06 02:30:56 +00:00
#402: M1359547
This commit is contained in:
parent
e9cd937020
commit
9a87f47d8e
@ -867,7 +867,8 @@ EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
|
||||
// If there is an IMEContentObserver, we need to handle QueryContentEvent
|
||||
// with it.
|
||||
if (mIMEContentObserver) {
|
||||
mIMEContentObserver->HandleQueryContentEvent(aEvent);
|
||||
RefPtr<IMEContentObserver> contentObserver = mIMEContentObserver;
|
||||
contentObserver->HandleQueryContentEvent(aEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -561,6 +561,12 @@ IMEContentObserver::Destroy()
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
IMEContentObserver::Destroyed() const
|
||||
{
|
||||
return !mWidget;
|
||||
}
|
||||
|
||||
void
|
||||
IMEContentObserver::DisconnectFromEventStateManager()
|
||||
{
|
||||
@ -735,6 +741,16 @@ IMEContentObserver::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
|
||||
mIsHandlingQueryContentEvent = true;
|
||||
ContentEventHandler handler(GetPresContext());
|
||||
nsresult rv = handler.HandleQueryContentEvent(aEvent);
|
||||
if (NS_WARN_IF(Destroyed())) {
|
||||
// If this has already destroyed during querying the content, the query
|
||||
// is outdated even if it's succeeded. So, make the query fail.
|
||||
aEvent->mSucceeded = false;
|
||||
MOZ_LOG(sIMECOLog, LogLevel::Warning,
|
||||
("0x%p IMEContentObserver::HandleQueryContentEvent(), WARNING, "
|
||||
"IMEContentObserver has been destroyed during the query, "
|
||||
"making the query fail", this));
|
||||
return rv;
|
||||
}
|
||||
if (aEvent->mSucceeded) {
|
||||
// We need to guarantee that mRootContent should be always same value for
|
||||
// the observing editor.
|
||||
|
@ -74,6 +74,8 @@ public:
|
||||
void Init(nsIWidget* aWidget, nsPresContext* aPresContext,
|
||||
nsIContent* aContent, nsIEditor* aEditor);
|
||||
void Destroy();
|
||||
bool Destroyed() const;
|
||||
|
||||
/**
|
||||
* IMEContentObserver is stored by EventStateManager during observing.
|
||||
* DisconnectFromEventStateManager() is called when EventStateManager stops
|
||||
|
Loading…
x
Reference in New Issue
Block a user