2012-02-20 07:45:29 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-06-29 03:42:59 -07:00
|
|
|
/* vim: set expandtab shiftwidth=2 tabstop=2: */
|
2012-05-21 04:12:37 -07: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 07:45:29 -08: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 09:23:19 -08:00
|
|
|
~StyleInfo() { }
|
2012-02-20 07:45:29 -08:00
|
|
|
|
|
|
|
void Display(nsAString& aValue);
|
|
|
|
void TextAlign(nsAString& aValue);
|
|
|
|
void TextIndent(nsAString& aValue);
|
2014-06-28 03:13:13 -07: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 07:45:29 -08:00
|
|
|
|
2012-02-28 23:35:51 -08:00
|
|
|
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
|
|
|
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
|
2012-08-22 08:56:38 -07:00
|
|
|
static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
|
2012-02-27 06:43:39 -08:00
|
|
|
|
2012-02-20 07:45:29 -08:00
|
|
|
private:
|
2015-01-06 15:35:02 -08:00
|
|
|
StyleInfo() = delete;
|
|
|
|
StyleInfo(const StyleInfo&) = delete;
|
|
|
|
StyleInfo& operator = (const StyleInfo&) = delete;
|
2012-02-20 07:45:29 -08:00
|
|
|
|
2014-06-28 03:13:13 -07:00
|
|
|
void Margin(Side aSide, nsAString& aValue);
|
2012-02-20 07:45:29 -08:00
|
|
|
|
|
|
|
dom::Element* mElement;
|
|
|
|
nsRefPtr<nsStyleContext> mStyleContext;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|