Bug 1040087 - For root scroll frames, use the canvas background color calculated by the pres shell when overscrolling. r=tn

This commit is contained in:
Botond Ballo 2014-08-06 18:05:11 -04:00
Родитель 69c1b339fe
Коммит 720158f10e
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -832,12 +832,13 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
// Also compute and set the background color on the container.
// This is needed for APZ overscrolling support.
if (aScrollFrame) {
// FindBackground() does not work for a root scroll frame, need to use the
// root frame instead.
nsIFrame* backgroundFrame = isRootScrollFrame ? presShell->GetRootFrame() : aScrollFrame;
nsStyleContext* backgroundStyle;
if (nsCSSRendering::FindBackground(backgroundFrame, &backgroundStyle)) {
aRoot->SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor);
if (isRootScrollFrame) {
aRoot->SetBackgroundColor(presShell->GetCanvasBackground());
} else {
nsStyleContext* backgroundStyle;
if (nsCSSRendering::FindBackground(aScrollFrame, &backgroundStyle)) {
aRoot->SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor);
}
}
}
}