зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 99011d150a1d (bug 1163572) for b2g ics debug bustage on a CLOSED TREE
This commit is contained in:
Родитель
f9dcb50ea7
Коммит
4542803729
|
@ -575,9 +575,8 @@ TabChildBase::ProcessUpdateFrame(const FrameMetrics& aFrameMetrics)
|
|||
}
|
||||
|
||||
FrameMetrics newMetrics = aFrameMetrics;
|
||||
nsCOMPtr<nsIContent> target = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
|
||||
if (target) {
|
||||
APZCCallbackHelper::UpdateRootFrame(target, newMetrics);
|
||||
if (nsCOMPtr<nsIPresShell> presShell = GetPresShell()) {
|
||||
APZCCallbackHelper::UpdateRootFrame(presShell, newMetrics);
|
||||
}
|
||||
|
||||
CSSSize cssCompositedSize = newMetrics.CalculateCompositedSizeInCssPixels();
|
||||
|
|
|
@ -163,31 +163,18 @@ SetDisplayPortMargins(nsIPresShell* aPresShell,
|
|||
nsLayoutUtils::SetDisplayPortBaseIfNotSet(aContent, base);
|
||||
}
|
||||
|
||||
static already_AddRefed<nsIPresShell>
|
||||
GetPresShell(const nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIPresShell> result;
|
||||
if (nsIDocument* doc = aContent->GetComposedDoc()) {
|
||||
result = doc->GetShell();
|
||||
}
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
void
|
||||
APZCCallbackHelper::UpdateRootFrame(nsIContent* aContent,
|
||||
APZCCallbackHelper::UpdateRootFrame(nsIPresShell* aPresShell,
|
||||
FrameMetrics& aMetrics)
|
||||
{
|
||||
// Precondition checks
|
||||
MOZ_ASSERT(aContent);
|
||||
MOZ_ASSERT(aPresShell);
|
||||
MOZ_ASSERT(aMetrics.GetUseDisplayPortMargins());
|
||||
nsCOMPtr<nsIPresShell> shell = GetPresShell(aContent);
|
||||
MOZ_ASSERT(shell);
|
||||
|
||||
if (aMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
float presShellResolution = nsLayoutUtils::GetResolution(shell);
|
||||
float presShellResolution = nsLayoutUtils::GetResolution(aPresShell);
|
||||
|
||||
// If the pres shell resolution has changed on the content side side
|
||||
// the time this repaint request was fired, consider this request out of date
|
||||
|
@ -207,19 +194,30 @@ APZCCallbackHelper::UpdateRootFrame(nsIContent* aContent,
|
|||
// Note that this needs to happen before scrolling the frame (in UpdateFrameCommon),
|
||||
// otherwise the scroll position may get clamped incorrectly.
|
||||
CSSSize scrollPort = aMetrics.CalculateCompositedSizeInCssPixels();
|
||||
nsLayoutUtils::SetScrollPositionClampingScrollPortSize(shell, scrollPort);
|
||||
nsLayoutUtils::SetScrollPositionClampingScrollPortSize(aPresShell, scrollPort);
|
||||
|
||||
// The pres shell resolution is updated by the the async zoom since the
|
||||
// last paint.
|
||||
presShellResolution = aMetrics.GetPresShellResolution()
|
||||
* aMetrics.GetAsyncZoom().scale;
|
||||
nsLayoutUtils::SetResolutionAndScaleTo(shell, presShellResolution);
|
||||
nsLayoutUtils::SetResolutionAndScaleTo(aPresShell, presShellResolution);
|
||||
|
||||
// Do this as late as possible since scrolling can flush layout. It also
|
||||
// adjusts the display port margins, so do it before we set those.
|
||||
ScrollFrame(aContent, aMetrics);
|
||||
nsIContent* content = nsLayoutUtils::FindContentFor(aMetrics.GetScrollId());
|
||||
ScrollFrame(content, aMetrics);
|
||||
|
||||
SetDisplayPortMargins(shell, aContent, aMetrics);
|
||||
SetDisplayPortMargins(aPresShell, content, aMetrics);
|
||||
}
|
||||
|
||||
static already_AddRefed<nsIPresShell>
|
||||
GetPresShell(const nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIPresShell> result;
|
||||
if (nsIDocument* doc = aContent->GetComposedDoc()) {
|
||||
result = doc->GetShell();
|
||||
}
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
Setting the scroll position can cause some small adjustments to be made
|
||||
to the actual scroll position. aMetrics' display port and scroll position
|
||||
will be updated with any modifications made. */
|
||||
static void UpdateRootFrame(nsIContent* aPresShell,
|
||||
static void UpdateRootFrame(nsIPresShell* aPresShell,
|
||||
FrameMetrics& aMetrics);
|
||||
|
||||
/* Applies the scroll parameters from the given FrameMetrics object to the subframe
|
||||
|
|
|
@ -76,17 +76,9 @@ ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
|
||||
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);
|
||||
}
|
||||
if (targetContent) {
|
||||
FrameMetrics metrics = aFrameMetrics;
|
||||
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче