Bug 951793 - Store the overscroll behavior in ScrollMetadata and propagate it to APZ. r=mstange
MozReview-Commit-ID: J7Vkd941QxK
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "FrameMetrics.h"
|
||||
#include "gfxPrefs.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
@@ -18,6 +19,31 @@ ScrollMetadata::SetUsesContainerScrolling(bool aValue) {
|
||||
mUsesContainerScrolling = aValue;
|
||||
}
|
||||
|
||||
static OverscrollBehavior
|
||||
ToOverscrollBehavior(StyleOverscrollBehavior aBehavior)
|
||||
{
|
||||
switch (aBehavior) {
|
||||
case StyleOverscrollBehavior::Auto:
|
||||
return OverscrollBehavior::Auto;
|
||||
case StyleOverscrollBehavior::Contain:
|
||||
return OverscrollBehavior::Contain;
|
||||
case StyleOverscrollBehavior::None:
|
||||
return OverscrollBehavior::None;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid overscroll behavior");
|
||||
return OverscrollBehavior::Auto;
|
||||
}
|
||||
|
||||
OverscrollBehaviorInfo
|
||||
OverscrollBehaviorInfo::FromStyleConstants(StyleOverscrollBehavior aBehaviorX,
|
||||
StyleOverscrollBehavior aBehaviorY)
|
||||
{
|
||||
OverscrollBehaviorInfo result;
|
||||
result.mBehaviorX = ToOverscrollBehavior(aBehaviorX);
|
||||
result.mBehaviorY = ToOverscrollBehavior(aBehaviorY);
|
||||
return result;
|
||||
}
|
||||
|
||||
StaticAutoPtr<const ScrollMetadata> ScrollMetadata::sNullMetadata;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user