1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_ScrollStyles_h
8 #define mozilla_ScrollStyles_h
12 // Forward declarations
13 struct nsStyleDisplay
;
17 enum class StyleOverflow
: uint8_t;
20 // Always one of Scroll, Hidden, or Auto.
21 StyleOverflow mHorizontal
;
22 StyleOverflow mVertical
;
24 ScrollStyles(StyleOverflow aH
, StyleOverflow aV
);
26 // NOTE: This ctor maps `visible` to `auto` and `clip` to `hidden`.
27 // It's used for styles that are propagated from the <body> and for
28 // scroll frames (which we create also for overflow:clip/visible in
29 // some cases, e.g. form controls).
30 enum MapOverflowToValidScrollStyleTag
{ MapOverflowToValidScrollStyle
};
31 ScrollStyles(const nsStyleDisplay
&, MapOverflowToValidScrollStyleTag
);
33 bool operator==(const ScrollStyles
& aStyles
) const {
34 return aStyles
.mHorizontal
== mHorizontal
&& aStyles
.mVertical
== mVertical
;
36 bool operator!=(const ScrollStyles
& aStyles
) const {
37 return !(*this == aStyles
);
39 bool IsHiddenInBothDirections() const;
42 } // namespace mozilla
44 #endif // mozilla_ScrollStyles_h