accessible/src/base/StyleInfo.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 expandtab shiftwidth=2 tabstop=2: */
     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_a11y_style_h_
     8 #define _mozilla_a11y_style_h_
    10 #include "mozilla/gfx/Types.h"
    11 #include "nsStyleContext.h"
    13 namespace mozilla {
    14 namespace a11y {
    16 class StyleInfo
    17 {
    18 public:
    19   StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell);
    20   ~StyleInfo() { }
    22   void Display(nsAString& aValue);
    23   void TextAlign(nsAString& aValue);
    24   void TextIndent(nsAString& aValue);
    25   void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); }
    26   void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); }
    27   void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
    28   void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
    30   static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
    31   static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
    32   static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
    34 private:
    35   StyleInfo() MOZ_DELETE;
    36   StyleInfo(const StyleInfo&) MOZ_DELETE;
    37   StyleInfo& operator = (const StyleInfo&) MOZ_DELETE;
    39   void Margin(css::Side aSide, nsAString& aValue);
    41   dom::Element* mElement;
    42   nsRefPtr<nsStyleContext> mStyleContext;
    43 };
    45 } // namespace a11y
    46 } // namespace mozilla
    48 #endif

mercurial