Bug 980493 - Transition FrameMetrics::mScrollOffset to use a getter/setter. r=kats

This commit is contained in:
Botond Ballo
2014-03-13 02:34:34 -04:00
parent 882ab59a56
commit 66174331db
16 changed files with 104 additions and 89 deletions

View File

@@ -68,7 +68,7 @@ MaybeAlignAndClampDisplayPort(mozilla::layers::FrameMetrics& aFrameMetrics,
// Correct the display-port by the difference between the requested scroll
// offset and the resulting scroll offset after setting the requested value.
CSSRect& displayPort = aFrameMetrics.mDisplayPort;
displayPort += aFrameMetrics.mScrollOffset - aActualScrollOffset;
displayPort += aFrameMetrics.GetScrollOffset() - aActualScrollOffset;
// Expand the display port to the next tile boundaries, if tiled thebes layers
// are enabled.
@@ -162,7 +162,7 @@ APZCCallbackHelper::UpdateRootFrame(nsIDOMWindowUtils* aUtils,
// Scroll the window to the desired spot
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aMetrics.mScrollId);
bool scrollUpdated = false;
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.mScrollOffset, scrollUpdated);
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.GetScrollOffset(), scrollUpdated);
if (!scrollUpdated) {
// For whatever reason we couldn't update the scroll offset on the scroll frame,
@@ -179,7 +179,7 @@ APZCCallbackHelper::UpdateRootFrame(nsIDOMWindowUtils* aUtils,
// enabled), and clamp it to the scrollable rect.
MaybeAlignAndClampDisplayPort(aMetrics, actualScrollOffset);
aMetrics.mScrollOffset = actualScrollOffset;
aMetrics.SetScrollOffset(actualScrollOffset);
// The mZoom variable on the frame metrics stores the CSS-to-screen scale for this
// frame. This scale includes all of the (cumulative) resolutions set on the presShells
@@ -232,7 +232,7 @@ APZCCallbackHelper::UpdateSubFrame(nsIContent* aContent,
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aMetrics.mScrollId);
bool scrollUpdated = false;
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.mScrollOffset, scrollUpdated);
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.GetScrollOffset(), scrollUpdated);
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aContent);
if (element) {
@@ -247,7 +247,7 @@ APZCCallbackHelper::UpdateSubFrame(nsIContent* aContent,
element, 0);
}
aMetrics.mScrollOffset = actualScrollOffset;
aMetrics.SetScrollOffset(actualScrollOffset);
}
already_AddRefed<nsIDOMWindowUtils>
@@ -338,7 +338,7 @@ APZCCallbackHelper::UpdateCallbackTransform(const FrameMetrics& aApzcMetrics, co
if (!content) {
return;
}
CSSPoint scrollDelta = aApzcMetrics.mScrollOffset - aActualMetrics.mScrollOffset;
CSSPoint scrollDelta = aApzcMetrics.GetScrollOffset() - aActualMetrics.GetScrollOffset();
content->SetProperty(nsGkAtoms::apzCallbackTransform, new CSSPoint(scrollDelta), DestroyCSSPoint);
}