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"
|
2018-03-22 21:20:41 +03:00
|
|
|
#include "mozilla/ComputedStyle.h"
|
2012-02-20 19:45:29 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2018-03-29 14:15:46 +03:00
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
2012-02-20 19:45:29 +04:00
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
class StyleInfo
|
|
|
|
{
|
|
|
|
public:
|
2018-01-23 17:49:00 +03:00
|
|
|
explicit StyleInfo(dom::Element* aElement);
|
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);
|
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;
|
2018-03-22 21:20:41 +03:00
|
|
|
RefPtr<ComputedStyle> mComputedStyle;
|
2012-02-20 19:45:29 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|