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
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set expandtab shiftwidth=2 tabstop=2: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef _mozilla_a11y_style_h_ |
michael@0 | 8 | #define _mozilla_a11y_style_h_ |
michael@0 | 9 | |
michael@0 | 10 | #include "mozilla/gfx/Types.h" |
michael@0 | 11 | #include "nsStyleContext.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace a11y { |
michael@0 | 15 | |
michael@0 | 16 | class StyleInfo |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell); |
michael@0 | 20 | ~StyleInfo() { } |
michael@0 | 21 | |
michael@0 | 22 | void Display(nsAString& aValue); |
michael@0 | 23 | void TextAlign(nsAString& aValue); |
michael@0 | 24 | void TextIndent(nsAString& aValue); |
michael@0 | 25 | void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); } |
michael@0 | 26 | void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); } |
michael@0 | 27 | void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); } |
michael@0 | 28 | void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); } |
michael@0 | 29 | |
michael@0 | 30 | static void FormatColor(const nscolor& aValue, nsString& aFormattedValue); |
michael@0 | 31 | static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue); |
michael@0 | 32 | static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue); |
michael@0 | 33 | |
michael@0 | 34 | private: |
michael@0 | 35 | StyleInfo() MOZ_DELETE; |
michael@0 | 36 | StyleInfo(const StyleInfo&) MOZ_DELETE; |
michael@0 | 37 | StyleInfo& operator = (const StyleInfo&) MOZ_DELETE; |
michael@0 | 38 | |
michael@0 | 39 | void Margin(css::Side aSide, nsAString& aValue); |
michael@0 | 40 | |
michael@0 | 41 | dom::Element* mElement; |
michael@0 | 42 | nsRefPtr<nsStyleContext> mStyleContext; |
michael@0 | 43 | }; |
michael@0 | 44 | |
michael@0 | 45 | } // namespace a11y |
michael@0 | 46 | } // namespace mozilla |
michael@0 | 47 | |
michael@0 | 48 | #endif |