2017-10-27 20:33:53 +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: */
|
2013-08-24 00:20:07 +04: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/. */
|
|
|
|
|
2018-08-01 09:14:26 +03:00
|
|
|
#ifndef mozilla_ScrollStyles_h
|
|
|
|
#define mozilla_ScrollStyles_h
|
2013-08-24 00:20:07 +04:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2014-02-04 05:54:22 +04:00
|
|
|
// Forward declarations
|
|
|
|
struct nsStyleDisplay;
|
|
|
|
|
2013-08-24 00:20:07 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
2020-02-11 04:23:37 +03:00
|
|
|
enum class StyleOverflow : uint8_t;
|
|
|
|
|
2018-08-01 09:14:26 +03:00
|
|
|
struct ScrollStyles {
|
2020-08-01 04:57:41 +03:00
|
|
|
// Always one of Scroll, Hidden, or Auto.
|
2018-12-11 03:50:32 +03:00
|
|
|
StyleOverflow mHorizontal;
|
|
|
|
StyleOverflow mVertical;
|
2019-10-15 15:40:14 +03:00
|
|
|
|
2020-08-01 04:57:41 +03:00
|
|
|
ScrollStyles(StyleOverflow aH, StyleOverflow aV);
|
|
|
|
|
|
|
|
// NOTE: This ctor maps `visible` to `auto` and `clip` to `hidden`.
|
|
|
|
// It's used for styles that are propagated from the <body> and for
|
|
|
|
// scroll frames (which we create also for overflow:clip/visible in
|
|
|
|
// some cases, e.g. form controls).
|
|
|
|
enum MapOverflowToValidScrollStyleTag { MapOverflowToValidScrollStyle };
|
|
|
|
ScrollStyles(const nsStyleDisplay&, MapOverflowToValidScrollStyleTag);
|
2019-10-22 15:16:13 +03:00
|
|
|
|
2018-08-01 09:14:26 +03:00
|
|
|
bool operator==(const ScrollStyles& aStyles) const {
|
2019-10-22 15:16:13 +03:00
|
|
|
return aStyles.mHorizontal == mHorizontal && aStyles.mVertical == mVertical;
|
2013-08-24 00:20:07 +04:00
|
|
|
}
|
2018-08-01 09:14:26 +03:00
|
|
|
bool operator!=(const ScrollStyles& aStyles) const {
|
2014-02-04 05:54:22 +04:00
|
|
|
return !(*this == aStyles);
|
2014-09-15 23:30:00 +04:00
|
|
|
}
|
2020-02-11 04:23:37 +03:00
|
|
|
bool IsHiddenInBothDirections() const;
|
2013-08-24 00:20:07 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2013-08-24 00:20:07 +04:00
|
|
|
|
2018-08-01 09:14:26 +03:00
|
|
|
#endif // mozilla_ScrollStyles_h
|