Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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