Bug 1163572 - Have ChromeProcessController also handle root-frame repaint requests. r=botond

Original patch by Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>.
This commit is contained in:
Kartikaya Gupta 2015-06-15 14:39:06 -04:00
parent e2e33e1957
commit 8cd41536e9
3 changed files with 10 additions and 5 deletions

View File

@ -423,6 +423,7 @@ TabChildBase::HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize)
defaultZoom <= viewportInfo.GetMaxZoom());
metrics.SetZoom(CSSToParentLayerScale2D(ConvertScaleForRoot(defaultZoom)));
metrics.SetPresShellId(presShellId);
metrics.SetScrollId(viewId);
}

View File

@ -185,7 +185,7 @@ APZCCallbackHelper::UpdateRootFrame(FrameMetrics& aMetrics)
}
nsCOMPtr<nsIPresShell> shell = GetPresShell(content);
if (!shell) {
if (!shell || aMetrics.GetPresShellId() != shell->GetPresShellId()) {
return;
}

View File

@ -75,10 +75,14 @@ ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics
return;
}
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
if (targetContent) {
FrameMetrics metrics = aFrameMetrics;
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
FrameMetrics metrics = aFrameMetrics;
if (metrics.IsRootContent()) {
APZCCallbackHelper::UpdateRootFrame(metrics);
} else {
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
if (targetContent) {
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
}
}
}