Bug 1494333 - index crons just like artifacts r=Callek
[gecko.git] / dom / html / HTMLHeadingElement.cpp
blobb3f97cb8197ae1ea26111a7fea71d6961aacd8e8
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/. */
7 #include "mozilla/dom/HTMLHeadingElement.h"
8 #include "mozilla/dom/HTMLHeadingElementBinding.h"
10 #include "mozilla/MappedDeclarations.h"
11 #include "nsGkAtoms.h"
12 #include "nsStyleConsts.h"
13 #include "nsMappedAttributes.h"
14 #include "mozAutoDocUpdate.h"
16 NS_IMPL_NS_NEW_HTML_ELEMENT(Heading)
18 namespace mozilla {
19 namespace dom {
21 HTMLHeadingElement::~HTMLHeadingElement()
25 NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)
27 JSObject*
28 HTMLHeadingElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
30 return HTMLHeadingElement_Binding::Wrap(aCx, this, aGivenProto);
33 bool
34 HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
35 nsAtom* aAttribute,
36 const nsAString& aValue,
37 nsIPrincipal* aMaybeScriptedPrincipal,
38 nsAttrValue& aResult)
40 if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
41 return ParseDivAlignValue(aValue, aResult);
44 return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
45 aMaybeScriptedPrincipal, aResult);
48 void
49 HTMLHeadingElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
50 MappedDeclarations& aDecls)
52 nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
53 nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
56 NS_IMETHODIMP_(bool)
57 HTMLHeadingElement::IsAttributeMapped(const nsAtom* aAttribute) const
59 static const MappedAttributeEntry* const map[] = {
60 sDivAlignAttributeMap,
61 sCommonAttributeMap
64 return FindAttributeDependence(aAttribute, map);
68 nsMapRuleToAttributesFunc
69 HTMLHeadingElement::GetAttributeMappingFunction() const
71 return &MapAttributesIntoRule;
74 } // namespace dom
75 } // namespace mozilla