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/. */
8 * nsMappedAttributeElement is the base for elements supporting style mapped
9 * attributes via nsMappedAttributes (HTML and MathML).
12 #ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
13 #define NS_MAPPEDATTRIBUTEELEMENT_H_
15 #include "mozilla/Attributes.h"
16 #include "nsStyledElement.h"
19 class MappedDeclarations
;
22 class nsMappedAttributes
;
25 using nsMapRuleToAttributesFunc
= void (*)(
26 const nsMappedAttributes
* aAttributes
, mozilla::MappedDeclarations
&);
28 using nsMappedAttributeElementBase
= nsStyledElement
;
30 class nsMappedAttributeElement
: public nsMappedAttributeElementBase
{
32 explicit nsMappedAttributeElement(
33 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
34 : nsMappedAttributeElementBase(std::move(aNodeInfo
)) {}
37 virtual nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const;
39 static void MapNoAttributesInto(const nsMappedAttributes
* aAttributes
,
40 mozilla::MappedDeclarations
&);
42 virtual bool SetAndSwapMappedAttribute(nsAtom
* aName
, nsAttrValue
& aValue
,
44 nsresult
* aRetval
) override
;
46 virtual void NodeInfoChanged(mozilla::dom::Document
* aOldDoc
) override
;
49 #endif // NS_MAPPEDATTRIBUTEELEMENT_H_