mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 915962 - Part 3: Do not crash when pressing the space bar without having an element focused; r=roc
This commit is contained in:
parent
9a2b100be9
commit
be10e8df64
@ -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();
|
||||
|
||||
SimpleTest.finish();
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user