Bug 309099. Entire client area should not be repainted for each focus move. Patch by Robert O'Callahan (roc). r=aaronlev, sr=neil

This commit is contained in:
aaronleventhal@moonset.net
2005-09-29 13:16:46 +00:00
parent a7cc29df1d
commit ae672f6d0b
2 changed files with 22 additions and 11 deletions

View File

@@ -2476,6 +2476,12 @@ nsDocShell::GetChildAt(PRInt32 aIndex, nsIDocShellTreeItem ** aChild)
NS_WARN_IF_FALSE(aIndex >=0 && aIndex < mChildList.Count(),
"index of child element is out of range!");
if (aIndex < 0) {
printf("Don't be so negative!");
}
else if (aIndex >= mChildList.Count()) {
printf("Don't be so unrealistic!");
}
nsIDocumentLoader* child = SafeChildAt(aIndex);
NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED);
@@ -8345,16 +8351,8 @@ nsDocShell::SetCanvasHasFocus(PRBool aCanvasHasFocus)
frame = frame->GetParent();
if (frame) {
nsICanvasFrame* canvasFrame;
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsICanvasFrame), (void**)&canvasFrame))) {
canvasFrame->SetHasFocus(aCanvasHasFocus);
nsIViewManager* vm = presShell->GetViewManager();
if (vm) {
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
}
return NS_OK;
}
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsICanvasFrame), (void**)&canvasFrame)))
return canvasFrame->SetHasFocus(aCanvasHasFocus);
}
}
return NS_ERROR_FAILURE;