mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 893973 Check if the keydown event received view actually has focus and separate the MOZ_CRASH() for each case r=smichaud
This commit is contained in:
parent
41b1df67ba
commit
659bbecf94
@ -951,6 +951,8 @@ public:
|
||||
void SetIMEOpenState(bool aOpen);
|
||||
void SetASCIICapableOnly(bool aASCIICapableOnly);
|
||||
|
||||
bool IsFocused();
|
||||
|
||||
static CFArrayRef CreateAllIMEModeList();
|
||||
static void DebugPrintAllIMEModes();
|
||||
|
||||
@ -973,7 +975,6 @@ protected:
|
||||
IMEInputHandler(nsChildView* aWidget, NSView<mozView> *aNativeView);
|
||||
virtual ~IMEInputHandler();
|
||||
|
||||
bool IsFocused();
|
||||
void ResetTimer();
|
||||
|
||||
virtual void ExecutePendingMethods();
|
||||
|
@ -5207,10 +5207,18 @@ static int32_t RoundUp(double aDouble)
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
#if !defined(RELEASE_BUILD) || defined(DEBUG)
|
||||
if (mGeckoChild &&
|
||||
mGeckoChild->GetInputContext().IsPasswordEditor() !=
|
||||
TextInputHandler::IsSecureEventInputEnabled()) {
|
||||
MOZ_CRASH("in wrong secure input mode");
|
||||
if (mGeckoChild && mTextInputHandler && mTextInputHandler->IsFocused()) {
|
||||
if (mIsPluginView) {
|
||||
if (TextInputHandler::IsSecureEventInputEnabled()) {
|
||||
MOZ_CRASH("While a plugin has focus, we must not be in secure mode");
|
||||
}
|
||||
} else if (mGeckoChild->GetInputContext().IsPasswordEditor() &&
|
||||
!TextInputHandler::IsSecureEventInputEnabled()) {
|
||||
MOZ_CRASH("A password editor has focus, but not in secure input mode");
|
||||
} else if (!mGeckoChild->GetInputContext().IsPasswordEditor() &&
|
||||
TextInputHandler::IsSecureEventInputEnabled()) {
|
||||
MOZ_CRASH("A non-password editor has focus, but in secure input mode");
|
||||
}
|
||||
}
|
||||
#endif // #if !defined(RELEASE_BUILD) || defined(DEBUG)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user