gecko/layout/base/ScrollbarStyles.h
Kearwood (Kip) Gilbert f760088bbb Bug 1010538 - Part 2 - Add scroll-behavior to ScrollbarStyles. r=mstange
- ScrollbarStyles extended to support the scroll-behavior CSS property
- Corrected naming of parameters to ScrollbarStyles CTOR
2014-09-15 12:30:00 -07:00

45 lines
1.5 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef ScrollbarStyles_h
#define ScrollbarStyles_h
#include <stdint.h>
#include "nsStyleConsts.h"
namespace mozilla {
struct ScrollbarStyles
{
// Always one of NS_STYLE_OVERFLOW_SCROLL, NS_STYLE_OVERFLOW_HIDDEN,
// or NS_STYLE_OVERFLOW_AUTO.
uint8_t mHorizontal;
uint8_t mVertical;
// Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO,
// NS_STYLE_SCROLL_BEHAVIOR_INSTANT, or
// NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
uint8_t mScrollBehavior;
ScrollbarStyles(uint8_t aH, uint8_t aV, uint8_t aB) : mHorizontal(aH),
mVertical(aV),
mScrollBehavior(aB) {}
ScrollbarStyles() {}
bool operator==(const ScrollbarStyles& aStyles) const {
return aStyles.mHorizontal == mHorizontal && aStyles.mVertical == mVertical &&
aStyles.mScrollBehavior == mScrollBehavior;
}
bool operator!=(const ScrollbarStyles& aStyles) const {
return aStyles.mHorizontal != mHorizontal || aStyles.mVertical != mVertical ||
aStyles.mScrollBehavior != mScrollBehavior;
}
bool IsHiddenInBothDirections() {
return mHorizontal == NS_STYLE_OVERFLOW_HIDDEN &&
mVertical == NS_STYLE_OVERFLOW_HIDDEN;
}
};
}
#endif