Bug 1001582 - HasScrollgrab transitioned from private to public member, getter/setter added. r=kats

This commit is contained in:
kylma 2014-06-25 19:16:27 -04:00
parent 3bcbe917e1
commit 80b1c2d236
4 changed files with 16 additions and 6 deletions

View File

@ -354,10 +354,17 @@ public:
// Whether or not this is the root scroll frame for the root content document.
bool mIsRoot;
// Whether or not this frame is for an element marked 'scrollgrab'.
bool mHasScrollgrab;
public:
void SetHasScrollgrab(bool aHasScrollgrab)
{
mHasScrollgrab = aHasScrollgrab;
}
bool GetHasScrollgrab() const
{
return mHasScrollgrab;
}
void SetScrollOffset(const CSSPoint& aScrollOffset)
{
mScrollOffset = aScrollOffset;
@ -460,6 +467,9 @@ private:
// New fields from now on should be made private and old fields should
// be refactored to be private.
// Whether or not this frame is for an element marked 'scrollgrab'.
bool mHasScrollgrab;
// A unique ID assigned to each scrollable frame.
ViewID mScrollId;

View File

@ -2291,7 +2291,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
mFrameMetrics.SetRootCompositionSize(aLayerMetrics.GetRootCompositionSize());
mFrameMetrics.mResolution = aLayerMetrics.mResolution;
mFrameMetrics.mCumulativeResolution = aLayerMetrics.mCumulativeResolution;
mFrameMetrics.mHasScrollgrab = aLayerMetrics.mHasScrollgrab;
mFrameMetrics.SetHasScrollgrab(aLayerMetrics.GetHasScrollgrab());
if (scrollOffsetUpdated) {
APZC_LOG("%p updating scroll offset from (%f, %f) to (%f, %f)\n", this,

View File

@ -316,7 +316,7 @@ public:
* Returns whether this APZC is for an element marked with the 'scrollgrab'
* attribute.
*/
bool HasScrollgrab() const { return mFrameMetrics.mHasScrollgrab; }
bool HasScrollgrab() const { return mFrameMetrics.GetHasScrollgrab(); }
/**
* Returns whether this APZC has room to be panned (in any direction).

View File

@ -813,7 +813,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
// in the FrameMetrics so APZ knows to provide the scroll grabbing
// behaviour.
if (aScrollFrame && nsContentUtils::HasScrollgrab(aScrollFrame->GetContent())) {
metrics.mHasScrollgrab = true;
metrics.SetHasScrollgrab(true);
}
aRoot->SetFrameMetrics(metrics);