2012-02-20 15:45:29 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-06-29 10:42:59 +00:00
|
|
|
/* vim: set expandtab shiftwidth=2 tabstop=2: */
|
2012-05-21 11:12:37 +00: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 15:45:29 +00:00
|
|
|
|
|
|
|
#ifndef _mozilla_a11y_style_h_
|
|
|
|
#define _mozilla_a11y_style_h_
|
|
|
|
|
|
|
|
#include "mozilla/gfx/Types.h"
|
2018-03-22 18:20:41 +00:00
|
|
|
#include "mozilla/ComputedStyle.h"
|
2012-02-20 15:45:29 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
2018-03-29 11:15:46 +00:00
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
2012-02-20 15:45:29 +00:00
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
class StyleInfo {
|
|
|
|
public:
|
2018-01-23 14:49:00 +00:00
|
|
|
explicit StyleInfo(dom::Element* aElement);
|
2012-12-09 17:23:19 +00:00
|
|
|
~StyleInfo() {}
|
2012-02-20 15:45:29 +00:00
|
|
|
|
|
|
|
void Display(nsAString& aValue);
|
|
|
|
void TextAlign(nsAString& aValue);
|
|
|
|
void TextIndent(nsAString& aValue);
|
2014-06-28 10:13:13 +00: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 15:45:29 +00:00
|
|
|
|
2012-02-29 07:35:51 +00:00
|
|
|
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
2012-08-22 15:56:38 +00:00
|
|
|
static void FormatTextDecorationStyle(uint8_t aValue,
|
|
|
|
nsAString& aFormattedValue);
|
2012-02-27 14:43:39 +00:00
|
|
|
|
2012-02-20 15:45:29 +00:00
|
|
|
private:
|
2015-01-06 23:35:02 +00:00
|
|
|
StyleInfo() = delete;
|
|
|
|
StyleInfo(const StyleInfo&) = delete;
|
|
|
|
StyleInfo& operator=(const StyleInfo&) = delete;
|
2012-02-20 15:45:29 +00:00
|
|
|
|
2014-06-28 10:13:13 +00:00
|
|
|
void Margin(Side aSide, nsAString& aValue);
|
2012-02-20 15:45:29 +00:00
|
|
|
|
|
|
|
dom::Element* mElement;
|
2018-03-22 18:20:41 +00:00
|
|
|
RefPtr<ComputedStyle> mComputedStyle;
|
2012-02-20 15:45:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|