Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/html/HTMLHeadingElement.cpp
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
#include "mozilla/dom/HTMLHeadingElement.h"
8
#include "mozilla/dom/HTMLHeadingElementBinding.h"
9
10
#include "mozilla/MappedDeclarations.h"
11
#include "nsGkAtoms.h"
12
#include "nsStyleConsts.h"
13
#include "nsMappedAttributes.h"
14
#include "mozAutoDocUpdate.h"
15
16
NS_IMPL_NS_NEW_HTML_ELEMENT(Heading)
17
18
namespace mozilla {
19
namespace dom {
20
21
HTMLHeadingElement::~HTMLHeadingElement()
22
0
{
23
0
}
24
25
NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)
26
27
JSObject*
28
HTMLHeadingElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
29
0
{
30
0
  return HTMLHeadingElement_Binding::Wrap(aCx, this, aGivenProto);
31
0
}
32
33
bool
34
HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
35
                                   nsAtom* aAttribute,
36
                                   const nsAString& aValue,
37
                                   nsIPrincipal* aMaybeScriptedPrincipal,
38
                                   nsAttrValue& aResult)
39
0
{
40
0
  if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
41
0
    return ParseDivAlignValue(aValue, aResult);
42
0
  }
43
0
44
0
  return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
45
0
                                              aMaybeScriptedPrincipal, aResult);
46
0
}
47
48
void
49
HTMLHeadingElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
50
                                          MappedDeclarations& aDecls)
51
0
{
52
0
  nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
53
0
  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
54
0
}
55
56
NS_IMETHODIMP_(bool)
57
HTMLHeadingElement::IsAttributeMapped(const nsAtom* aAttribute) const
58
0
{
59
0
  static const MappedAttributeEntry* const map[] = {
60
0
    sDivAlignAttributeMap,
61
0
    sCommonAttributeMap
62
0
  };
63
0
64
0
  return FindAttributeDependence(aAttribute, map);
65
0
}
66
67
68
nsMapRuleToAttributesFunc
69
HTMLHeadingElement::GetAttributeMappingFunction() const
70
0
{
71
0
  return &MapAttributesIntoRule;
72
0
}
73
74
} // namespace dom
75
} // namespace mozilla