Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/style/nsDOMCSSValueList.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
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
/* DOM object representing lists of values in DOM computed style */
8
9
#ifndef nsDOMCSSValueList_h___
10
#define nsDOMCSSValueList_h___
11
12
#include "CSSValue.h"
13
#include "nsTArray.h"
14
15
class nsDOMCSSValueList final : public mozilla::dom::CSSValue
16
{
17
public:
18
  // nsDOMCSSValueList
19
  nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly);
20
21
  /**
22
   * Adds a value to this list.
23
   */
24
  void AppendCSSValue(already_AddRefed<CSSValue> aValue);
25
26
  void GetCssText(nsString& aText, mozilla::ErrorResult& aRv) final;
27
  void SetCssText(const nsAString& aText, mozilla::ErrorResult& aRv) final;
28
  uint16_t CssValueType() const final;
29
30
  void GetCssText(nsAString& aText);
31
32
  CSSValue* IndexedGetter(uint32_t aIdx, bool& aFound) const
33
0
  {
34
0
    aFound = aIdx <= Length();
35
0
    return Item(aIdx);
36
0
  }
37
38
  CSSValue* Item(uint32_t aIndex) const
39
0
  {
40
0
    return mCSSValues.SafeElementAt(aIndex);
41
0
  }
42
43
  uint32_t Length() const
44
0
  {
45
0
    return mCSSValues.Length();
46
0
  }
47
48
protected:
49
  virtual ~nsDOMCSSValueList();
50
51
  bool                        mCommaDelimited;  // some value lists use a comma
52
                                                // as the delimiter, some just use
53
                                                // spaces.
54
55
  bool                        mReadonly;    // Are we read-only?
56
57
  InfallibleTArray<RefPtr<CSSValue> > mCSSValues;
58
};
59
60
#endif /* nsDOMCSSValueList_h___ */