Line data Source code
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 : /**
8 : * nsMappedAttributeElement is the base for elements supporting style mapped
9 : * attributes via nsMappedAttributes (HTML and MathML).
10 : */
11 :
12 : #ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
13 : #define NS_MAPPEDATTRIBUTEELEMENT_H_
14 :
15 : #include "mozilla/Attributes.h"
16 : #include "mozilla/GenericSpecifiedValues.h"
17 : #include "nsStyledElement.h"
18 :
19 : class nsMappedAttributes;
20 : struct nsRuleData;
21 :
22 : typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes,
23 : mozilla::GenericSpecifiedValues* aData);
24 :
25 : typedef nsStyledElement nsMappedAttributeElementBase;
26 :
27 0 : class nsMappedAttributeElement : public nsMappedAttributeElementBase
28 : {
29 :
30 : protected:
31 :
32 97 : explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
33 97 : : nsMappedAttributeElementBase(aNodeInfo)
34 97 : {}
35 :
36 : public:
37 : virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
38 :
39 : static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
40 : mozilla::GenericSpecifiedValues* aGenericData);
41 :
42 : NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
43 : virtual bool SetAndSwapMappedAttribute(nsIAtom* aName,
44 : nsAttrValue& aValue,
45 : bool* aValueWasSet,
46 : nsresult* aRetval) override;
47 :
48 : virtual void NodeInfoChanged(nsIDocument* aOldDoc) override;
49 : };
50 :
51 : #endif // NS_MAPPEDATTRIBUTEELEMENT_H_
|