|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */ |
|
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 "nsStyledElement.h" |
|
17 |
|
18 class nsMappedAttributes; |
|
19 struct nsRuleData; |
|
20 |
|
21 typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes, |
|
22 nsRuleData* aData); |
|
23 |
|
24 typedef nsStyledElement nsMappedAttributeElementBase; |
|
25 |
|
26 class nsMappedAttributeElement : public nsMappedAttributeElementBase |
|
27 { |
|
28 |
|
29 protected: |
|
30 |
|
31 nsMappedAttributeElement(already_AddRefed<nsINodeInfo>& aNodeInfo) |
|
32 : nsMappedAttributeElementBase(aNodeInfo) |
|
33 {} |
|
34 |
|
35 public: |
|
36 virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const; |
|
37 |
|
38 static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, |
|
39 nsRuleData* aRuleData); |
|
40 |
|
41 NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE; |
|
42 virtual bool SetMappedAttribute(nsIDocument* aDocument, |
|
43 nsIAtom* aName, |
|
44 nsAttrValue& aValue, |
|
45 nsresult* aRetval) MOZ_OVERRIDE; |
|
46 }; |
|
47 |
|
48 #endif // NS_MAPPEDATTRIBUTEELEMENT_H_ |