tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ScrollStyles.h (1307B)


      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/. */
      6 
      7 #ifndef mozilla_ScrollStyles_h
      8 #define mozilla_ScrollStyles_h
      9 
     10 #include <stdint.h>
     11 
     12 // Forward declarations
     13 struct nsStyleDisplay;
     14 
     15 namespace mozilla {
     16 
     17 enum class StyleOverflow : uint8_t;
     18 
     19 struct ScrollStyles {
     20  // Always one of Scroll, Hidden, or Auto.
     21  StyleOverflow mHorizontal;
     22  StyleOverflow mVertical;
     23 
     24  ScrollStyles(StyleOverflow aH, StyleOverflow aV);
     25 
     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);
     32 
     33  bool operator==(const ScrollStyles&) const = default;
     34  bool operator!=(const ScrollStyles&) const = default;
     35 
     36  bool IsHiddenInBothDirections() const;
     37 };
     38 
     39 }  // namespace mozilla
     40 
     41 #endif  // mozilla_ScrollStyles_h