ScrollingCoordinatorTypes.h [plain text]
#pragma once
#include "ScrollTypes.h"
#include <wtf/EnumTraits.h>
namespace WebCore {
enum class SynchronousScrollingReason {
ForcedOnMainThread = 1 << 0,
HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 1,
HasNonLayerViewportConstrainedObjects = 1 << 2,
IsImageDocument = 1 << 3,
HasSlowRepaintObjects = 1 << 4,
DescendantScrollersHaveSynchronousScrolling = 1 << 5,
};
enum class ScrollingNodeType : uint8_t {
MainFrame,
Subframe,
FrameHosting,
Overflow,
OverflowProxy,
Fixed,
Sticky,
Positioned
};
enum ScrollingStateTreeAsTextBehaviorFlags {
ScrollingStateTreeAsTextBehaviorNormal = 0,
ScrollingStateTreeAsTextBehaviorIncludeLayerIDs = 1 << 0,
ScrollingStateTreeAsTextBehaviorIncludeNodeIDs = 1 << 1,
ScrollingStateTreeAsTextBehaviorIncludeLayerPositions = 1 << 2,
ScrollingStateTreeAsTextBehaviorDebug = ScrollingStateTreeAsTextBehaviorIncludeLayerIDs | ScrollingStateTreeAsTextBehaviorIncludeNodeIDs | ScrollingStateTreeAsTextBehaviorIncludeLayerPositions
};
typedef unsigned ScrollingStateTreeAsTextBehavior;
enum class ScrollingLayerPositionAction {
Set,
SetApproximate,
Sync
};
struct ScrollableAreaParameters {
ScrollElasticity horizontalScrollElasticity { ScrollElasticityNone };
ScrollElasticity verticalScrollElasticity { ScrollElasticityNone };
ScrollbarMode horizontalScrollbarMode { ScrollbarAuto };
ScrollbarMode verticalScrollbarMode { ScrollbarAuto };
bool allowsHorizontalScrolling { false };
bool allowsVerticalScrolling { false };
bool horizontalScrollbarHiddenByStyle { false };
bool verticalScrollbarHiddenByStyle { false };
bool useDarkAppearanceForScrollbars { false };
bool operator==(const ScrollableAreaParameters& other) const
{
return horizontalScrollElasticity == other.horizontalScrollElasticity
&& verticalScrollElasticity == other.verticalScrollElasticity
&& horizontalScrollbarMode == other.horizontalScrollbarMode
&& verticalScrollbarMode == other.verticalScrollbarMode
&& allowsHorizontalScrolling == other.allowsHorizontalScrolling
&& allowsVerticalScrolling == other.allowsVerticalScrolling
&& horizontalScrollbarHiddenByStyle == other.horizontalScrollbarHiddenByStyle
&& verticalScrollbarHiddenByStyle == other.verticalScrollbarHiddenByStyle
&& useDarkAppearanceForScrollbars == other.useDarkAppearanceForScrollbars;
}
};
enum class ViewportRectStability {
Stable,
Unstable,
ChangingObscuredInsetsInteractively };
}
namespace WTF {
template<> struct EnumTraits<WebCore::ScrollingNodeType> {
using values = EnumValues<
WebCore::ScrollingNodeType,
WebCore::ScrollingNodeType::MainFrame,
WebCore::ScrollingNodeType::Subframe,
WebCore::ScrollingNodeType::FrameHosting,
WebCore::ScrollingNodeType::Overflow,
WebCore::ScrollingNodeType::OverflowProxy,
WebCore::ScrollingNodeType::Fixed,
WebCore::ScrollingNodeType::Sticky,
WebCore::ScrollingNodeType::Positioned
>;
};
}