Bug 1128214 - Avoid a crash when attempting to render windows titlebar specific theme elements with e10s. r=roc

This commit is contained in:
Jim Mathies 2015-03-10 05:54:59 -05:00
parent 02d01a75e2
commit e76f5fee3f
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Testcase for bug 1128214</title>
<style type="text/css">
html,body {
color:black;
background-color:white;
font-size:16px;
padding:10px;
margin:0;
}
</style>
</head>
<body>
<div style="-moz-appearance:-moz-window-button-close; background-color: #ffd800; width:20px; height:20px;"></div>
</body>
</html>

View File

@ -1,3 +1,4 @@
load 303901-1.html
load 303901-2.html
load 380359-1.xhtml
load 1128214.html

View File

@ -65,6 +65,12 @@ nsNativeThemeWin::~nsNativeThemeWin()
static int32_t
GetTopLevelWindowActiveState(nsIFrame *aFrame)
{
// Used by window frame and button box rendering. We can end up in here in
// the content process when rendering one of these moz styles freely in a
// page. Bail in this case, there is no applicable window focus state.
if (XRE_GetProcessType() != GeckoProcessType_Default) {
return mozilla::widget::themeconst::FS_INACTIVE;
}
// Get the widget. nsIFrame's GetNearestWidget walks up the view chain
// until it finds a real window.
nsIWidget* widget = aFrame->GetNearestWidget();