mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 499912, crash activating window with no root element, r+sr=smaug
This commit is contained in:
parent
65d8462672
commit
29905dad37
@ -6654,6 +6654,7 @@ nsGlobalWindow::ActivateOrDeactivate(PRBool aActivate)
|
|||||||
nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(topLevelWindow);
|
nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(topLevelWindow);
|
||||||
if (xulDoc && chromeWin) {
|
if (xulDoc && chromeWin) {
|
||||||
nsCOMPtr<nsIContent> rootElem = doc->GetRootContent();
|
nsCOMPtr<nsIContent> rootElem = doc->GetRootContent();
|
||||||
|
if (rootElem) {
|
||||||
if (aActivate)
|
if (aActivate)
|
||||||
rootElem->SetAttr(kNameSpaceID_None, nsGkAtoms::active,
|
rootElem->SetAttr(kNameSpaceID_None, nsGkAtoms::active,
|
||||||
NS_LITERAL_STRING("true"), PR_TRUE);
|
NS_LITERAL_STRING("true"), PR_TRUE);
|
||||||
@ -6662,6 +6663,7 @@ nsGlobalWindow::ActivateOrDeactivate(PRBool aActivate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1119,13 +1119,29 @@ function switchWindowTest(otherWindow, framesetWindow)
|
|||||||
otherWindow.close();
|
otherWindow.close();
|
||||||
framesetWindow.close();
|
framesetWindow.close();
|
||||||
|
|
||||||
|
gRefocusCallback = doWindowNoRootTest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// open a window with no root element
|
||||||
|
var noRootWindow = null;
|
||||||
|
function doWindowNoRootTest()
|
||||||
|
{
|
||||||
|
var data = "data:application/vnd.mozilla.xul+xml," + unescape(
|
||||||
|
"<window onfocus='dostuff()' xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'" +
|
||||||
|
" style='-moz-user-focus: normal;'>" +
|
||||||
|
"<script>function dostuff() { setTimeout(function() { " +
|
||||||
|
"document.documentElement.focus(); document.removeChild(document.documentElement);" +
|
||||||
|
"window.opener.focus(); }, 100); }</script></window>");
|
||||||
|
|
||||||
gRefocusCallback = doFrameSwitchingTests;
|
gRefocusCallback = doFrameSwitchingTests;
|
||||||
|
noRootWindow = window.open(data, "_blank", "chrome,width=100,height=100");
|
||||||
}
|
}
|
||||||
|
|
||||||
// these tests check when focus is moved between a tree of frames to ensure
|
// these tests check when focus is moved between a tree of frames to ensure
|
||||||
// that the focus is in the right place at each event step.
|
// that the focus is in the right place at each event step.
|
||||||
function doFrameSwitchingTests()
|
function doFrameSwitchingTests()
|
||||||
{
|
{
|
||||||
|
noRootWindow.close();
|
||||||
gRefocusCallback = null;
|
gRefocusCallback = null;
|
||||||
|
|
||||||
var framea = document.getElementById("ifa");
|
var framea = document.getElementById("ifa");
|
||||||
|
Loading…
Reference in New Issue
Block a user