Coverage Report

Created: 2018-09-25 14:53

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