2012-02-20 19:45:29 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-06-29 14:42:59 +04:00
|
|
|
/* vim: set expandtab shiftwidth=2 tabstop=2: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-02-20 19:45:29 +04:00
|
|
|
|
|
|
|
#ifndef _mozilla_a11y_style_h_
|
|
|
|
#define _mozilla_a11y_style_h_
|
|
|
|
|
|
|
|
#include "mozilla/gfx/Types.h"
|
|
|
|
#include "nsStyleContext.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
class StyleInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell);
|
2012-12-09 21:23:19 +04:00
|
|
|
~StyleInfo() { }
|
2012-02-20 19:45:29 +04:00
|
|
|
|
|
|
|
void Display(nsAString& aValue);
|
|
|
|
void TextAlign(nsAString& aValue);
|
|
|
|
void TextIndent(nsAString& aValue);
|
2014-06-28 14:13:13 +04:00
|
|
|
void MarginLeft(nsAString& aValue) { Margin(eSideLeft, aValue); }
|
|
|
|
void MarginRight(nsAString& aValue) { Margin(eSideRight, aValue); }
|
|
|
|
void MarginTop(nsAString& aValue) { Margin(eSideTop, aValue); }
|
|
|
|
void MarginBottom(nsAString& aValue) { Margin(eSideBottom, aValue); }
|
2012-02-20 19:45:29 +04:00
|
|
|
|
2012-02-29 11:35:51 +04:00
|
|
|
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
|
|
|
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
|
2012-08-22 19:56:38 +04:00
|
|
|
static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
|
2012-02-27 18:43:39 +04:00
|
|
|
|
2012-02-20 19:45:29 +04:00
|
|
|
private:
|
2015-01-07 02:35:02 +03:00
|
|
|
StyleInfo() = delete;
|
|
|
|
StyleInfo(const StyleInfo&) = delete;
|
|
|
|
StyleInfo& operator = (const StyleInfo&) = delete;
|
2012-02-20 19:45:29 +04:00
|
|
|
|
2014-06-28 14:13:13 +04:00
|
|
|
void Margin(Side aSide, nsAString& aValue);
|
2012-02-20 19:45:29 +04:00
|
|
|
|
|
|
|
dom::Element* mElement;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsStyleContext> mStyleContext;
|
2012-02-20 19:45:29 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|