зеркало из https://github.com/mozilla/gecko-dev.git
Bug 915962 - Part 3: Do not crash when pressing the space bar without having an element focused; r=roc
This commit is contained in:
Родитель
345ba44baa
Коммит
3b10fd3fcb
|
@ -478,7 +478,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(EventTarget* aTarget, nsIDOMEvent* aEv
|
|||
}
|
||||
|
||||
// If the focus is in an editable region, don't scroll.
|
||||
if (focusedContent->IsEditable()) {
|
||||
if (focusedContent && focusedContent->IsEditable()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,22 @@ function startTest() {
|
|||
win.close();
|
||||
cwu.restoreNormalRefresh();
|
||||
|
||||
win = window.open("file_bug915962.html", "_blank",
|
||||
"width=600,height=600,scrollbars=yes");
|
||||
cwu = SpecialPowers.getDOMWindowUtils(win);
|
||||
SimpleTest.waitForFocus(function() {
|
||||
is(win.scrollY, 0, "Sanity check");
|
||||
synthesizeKey(" ", {}, win);
|
||||
|
||||
step();
|
||||
|
||||
isnot(win.scrollY, 0, "Page is scrolled down without crashing");
|
||||
|
||||
win.close();
|
||||
cwu.restoreNormalRefresh();
|
||||
|
||||
SimpleTest.finish();
|
||||
}, win);
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
|
|
Загрузка…
Ссылка в новой задаче