Bug 1812499 [wpt PR 38184] - Simplify handling of name-to-subdir mapping in canvas...
[gecko.git] / dom / base / nsMappedAttributeElement.h
blobb1389ac2102f192d13177163fe15dc7ae81b6c13
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 /**
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"
18 namespace mozilla {
19 class MappedDeclarations;
22 class nsMappedAttributes;
23 struct nsRuleData;
25 using nsMapRuleToAttributesFunc = void (*)(
26 const nsMappedAttributes* aAttributes, mozilla::MappedDeclarations&);
28 using nsMappedAttributeElementBase = nsStyledElement;
30 class nsMappedAttributeElement : public nsMappedAttributeElementBase {
31 protected:
32 explicit nsMappedAttributeElement(
33 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
34 : nsMappedAttributeElementBase(std::move(aNodeInfo)) {}
36 public:
37 virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
39 static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
40 mozilla::MappedDeclarations&);
42 virtual bool SetAndSwapMappedAttribute(nsAtom* aName, nsAttrValue& aValue,
43 bool* aValueWasSet,
44 nsresult* aRetval) override;
46 virtual void NodeInfoChanged(mozilla::dom::Document* aOldDoc) override;
49 #endif // NS_MAPPEDATTRIBUTEELEMENT_H_