tor-browser

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

AnonymousContentKey.h (1732B)


      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 /* values to identify particular subtrees of native anonymous content */
      8 
      9 #ifndef mozilla_AnonymousContentKey_h
     10 #define mozilla_AnonymousContentKey_h
     11 
     12 #include <stdint.h>
     13 
     14 #include "X11UndefineNone.h"
     15 #include "mozilla/TypedEnumBits.h"
     16 
     17 namespace mozilla {
     18 
     19 // clang-format off
     20 
     21 // We currently use cached anonymous content styles only for scrollbar parts,
     22 // and we can fit the type of scrollbar part element along with its different
     23 // options (such as orientation, and other attribute values that can affect
     24 // styling) into a uint8_t.
     25 //
     26 // The lower three bits hold a Type_* value identifying the type of
     27 // element, and the remaining bits store Flag_* values.
     28 //
     29 // A value of 0 is used to represent an anonymous content subtree that we don't
     30 // cache styles for.
     31 enum class AnonymousContentKey : uint8_t {
     32  None                           = 0x00,
     33 
     34  // all
     35  Type_ScrollCorner              = 0x01,
     36  Type_Scrollbar                 = 0x02,
     37  Type_ScrollbarButton           = 0x03,
     38  Type_Slider                    = 0x04,
     39 
     40  // scrollbar, scrollbarbutton, slider
     41  Flag_Vertical                  = 0x08,
     42 
     43  // scrollbarbutton
     44  Flag_ScrollbarButton_Down      = 0x10,
     45  Flag_ScrollbarButton_Bottom    = 0x20,
     46  Flag_ScrollbarButton_Decrement = 0x40,
     47 };
     48 
     49 // clang-format on
     50 
     51 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AnonymousContentKey)
     52 
     53 }  // namespace mozilla
     54 
     55 #endif  // mozilla_AnonymousContentKey_h