Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/base/nsMappedAttributeElement.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
/**
8
 * nsMappedAttributeElement is the base for elements supporting style mapped
9
 * attributes via nsMappedAttributes (HTML and MathML).
10
 */
11
12
#ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
13
#define NS_MAPPEDATTRIBUTEELEMENT_H_
14
15
#include "mozilla/Attributes.h"
16
#include "nsStyledElement.h"
17
18
namespace mozilla {
19
class MappedDeclarations;
20
}
21
22
class nsMappedAttributes;
23
struct nsRuleData;
24
25
typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes,
26
                                          mozilla::MappedDeclarations&);
27
28
typedef nsStyledElement nsMappedAttributeElementBase;
29
30
class nsMappedAttributeElement : public nsMappedAttributeElementBase
31
{
32
33
protected:
34
35
  explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
36
    : nsMappedAttributeElementBase(std::move(aNodeInfo))
37
0
  {}
38
39
public:
40
  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
41
42
  static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
43
                                  mozilla::MappedDeclarations&);
44
45
  virtual bool SetAndSwapMappedAttribute(nsAtom* aName,
46
                                         nsAttrValue& aValue,
47
                                         bool* aValueWasSet,
48
                                         nsresult* aRetval) override;
49
50
  virtual void NodeInfoChanged(nsIDocument* aOldDoc) override;
51
};
52
53
#endif // NS_MAPPEDATTRIBUTEELEMENT_H_