2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-07-13 18:53:10 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "FrameMetrics.h"
|
|
|
|
#include "gfxPrefs.h"
|
2017-10-19 03:13:19 +03:00
|
|
|
#include "nsStyleConsts.h"
|
2015-07-13 18:53:10 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
const FrameMetrics::ViewID FrameMetrics::NULL_SCROLL_ID = 0;
|
|
|
|
|
|
|
|
void
|
2016-04-27 23:06:34 +03:00
|
|
|
ScrollMetadata::SetUsesContainerScrolling(bool aValue) {
|
2015-07-13 18:53:10 +03:00
|
|
|
MOZ_ASSERT_IF(aValue, gfxPrefs::LayoutUseContainersForRootFrames());
|
|
|
|
mUsesContainerScrolling = aValue;
|
|
|
|
}
|
|
|
|
|
2017-10-19 03:13:19 +03:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-03-31 00:04:10 +03:00
|
|
|
StaticAutoPtr<const ScrollMetadata> ScrollMetadata::sNullMetadata;
|
2016-03-29 02:14:52 +03:00
|
|
|
|
|
|
|
}
|
2015-07-13 18:53:10 +03:00
|
|
|
}
|