accessible/src/generic/Accessible-inl.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=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 file,
     5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_a11y_Accessible_inl_h_
     8 #define mozilla_a11y_Accessible_inl_h_
    10 #include "Accessible.h"
    11 #include "ARIAMap.h"
    13 namespace mozilla {
    14 namespace a11y {
    16 inline mozilla::a11y::role
    17 Accessible::Role()
    18 {
    19   if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
    20     return ARIATransformRole(NativeRole());
    22   return ARIATransformRole(mRoleMapEntry->role);
    23 }
    25 inline bool
    26 Accessible::IsARIARole(nsIAtom* aARIARole) const
    27 {
    28   return mRoleMapEntry && mRoleMapEntry->Is(aARIARole);
    29 }
    31 inline mozilla::a11y::role
    32 Accessible::ARIARole()
    33 {
    34   if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
    35     return mozilla::a11y::roles::NOTHING;
    37   return ARIATransformRole(mRoleMapEntry->role);
    38 }
    40 inline bool
    41 Accessible::HasGenericType(AccGenericType aType) const
    42 {
    43   return (mGenericTypes & aType) ||
    44     (mRoleMapEntry && mRoleMapEntry->IsOfType(aType));
    45 }
    47 inline bool
    48 Accessible::HasNumericValue() const
    49 {
    50   if (mStateFlags & eHasNumericValue)
    51     return true;
    53   return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue;
    54 }
    56 } // namespace a11y
    57 } // namespace mozilla
    59 #endif

mercurial