зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1397711
- Null-check widget of keyboard event before invoking its PostHandleKeyEvent. r=masayuki
MozReview-Commit-ID: KTniEBMvw9q --HG-- extra : rebase_source : 3fa266b0097ee94f83c6567d5cebd66f41369d17
This commit is contained in:
Родитель
9785ff665d
Коммит
32fe2f2b94
|
@ -2894,7 +2894,9 @@ EventStateManager::PostHandleKeyboardEvent(WidgetKeyboardEvent* aKeyboardEvent,
|
|||
// dispatched to a content process (non-e10s or no content process
|
||||
// running), we need to short-circuit here. Otherwise, we need to wait for
|
||||
// the content process to handle the event.
|
||||
aKeyboardEvent->mWidget->PostHandleKeyEvent(aKeyboardEvent);
|
||||
if (aKeyboardEvent->mWidget) {
|
||||
aKeyboardEvent->mWidget->PostHandleKeyEvent(aKeyboardEvent);
|
||||
}
|
||||
if (aKeyboardEvent->DefaultPrevented()) {
|
||||
aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
let code = "x".charCodeAt(0);
|
||||
let e = new KeyboardEvent("keypress", {
|
||||
keyCode: code,
|
||||
charCode: code,
|
||||
bubbles: true
|
||||
});
|
||||
let utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
utils.dispatchDOMEventViaPresShell(document.documentElement, e, false);
|
||||
</script>
|
|
@ -16,3 +16,4 @@ load eventctor-nulldictionary.html
|
|||
load eventctor-nullstorage.html
|
||||
load recursive-DOMNodeInserted.html
|
||||
load recursive-onload.html
|
||||
load 1397711.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче