Coverage Report

Created: 2018-09-25 14:53

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