Bug 1163572 - Override ChromeProcessController::RequestContentRepaint to detect root-frame updates. r=botond

This commit is contained in:
Danilo Cesar Lemes de Paula
2015-05-28 06:54:00 +02:00
parent 504542a723
commit 47ac67fc92
4 changed files with 35 additions and 24 deletions

View File

@@ -76,9 +76,17 @@ ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics
}
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
if (targetContent) {
FrameMetrics metrics = aFrameMetrics;
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
FrameMetrics metrics = aFrameMetrics;
if (aFrameMetrics.GetIsRoot()) {
nsCOMPtr<nsIDocument> doc = targetContent->GetComposedDoc();
nsCOMPtr<nsIPresShell> shell = doc ? doc->GetShell() : nullptr;
if (shell && aFrameMetrics.GetPresShellId() == shell->GetPresShellId()) {
APZCCallbackHelper::UpdateRootFrame(targetContent, metrics);
}
} else {
if (targetContent) {
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
}
}
}