Bug 595337 - Crash [@ nsTextEditorState::InitializeKeyboardEventListeners] on print preview close with iframe, position:fixed and input r,a=roc

This commit is contained in:
Ehsan Akhgari 2010-09-13 16:36:43 -04:00
parent c96d21b6bf
commit a0c782c046
2 changed files with 19 additions and 4 deletions

View File

@ -218,6 +218,21 @@ function runTest4() {
function runTest4end() {
printpreview();
exitprintpreview();
setTimeout(runTest5, 0);
}
// This is a crash test for bug 595337
function runTest5() {
window.frames[0].document.body.innerHTML =
'<iframe style="position: fixed; visibility: hidden; bottom: 10em;"></iframe>' +
'<input contenteditable="true" style="display: table; page-break-before: left; width: 10000px;">';
setTimeout(runTest5end, 500);
}
function runTest5end() {
printpreview();
exitprintpreview();
SimpleTest.finish();
window.close();
}

View File

@ -1353,11 +1353,11 @@ nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
// than descending from the root frame of the frame hierarchy.
if (first) {
first->AddStateBits(NS_FRAME_REFLOW_ROOT);
}
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
NS_ASSERTION(txtCtrl, "Content not a text control element");
txtCtrl->InitializeKeyboardEventListeners();
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
NS_ASSERTION(txtCtrl, "Content not a text control element");
txtCtrl->InitializeKeyboardEventListeners();
}
return rv;
}