|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* DOM object for element.style */ |
|
7 |
|
8 #ifndef nsDOMCSSAttributeDeclaration_h |
|
9 #define nsDOMCSSAttributeDeclaration_h |
|
10 |
|
11 #include "mozilla/Attributes.h" |
|
12 #include "nsDOMCSSDeclaration.h" |
|
13 |
|
14 #include "nsAutoPtr.h" |
|
15 |
|
16 namespace mozilla { |
|
17 namespace dom { |
|
18 class Element; |
|
19 } |
|
20 } |
|
21 |
|
22 class nsDOMCSSAttributeDeclaration MOZ_FINAL : public nsDOMCSSDeclaration |
|
23 { |
|
24 public: |
|
25 typedef mozilla::dom::Element Element; |
|
26 nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride); |
|
27 ~nsDOMCSSAttributeDeclaration(); |
|
28 |
|
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
30 NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSAttributeDeclaration, |
|
31 nsICSSDeclaration) |
|
32 |
|
33 // If GetCSSDeclaration returns non-null, then the decl it returns |
|
34 // is owned by our current style rule. |
|
35 virtual mozilla::css::Declaration* GetCSSDeclaration(bool aAllocate); |
|
36 virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) MOZ_OVERRIDE; |
|
37 NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) MOZ_OVERRIDE; |
|
38 |
|
39 virtual nsINode* GetParentObject() MOZ_OVERRIDE; |
|
40 |
|
41 NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID, |
|
42 const nsAString& aValue) MOZ_OVERRIDE; |
|
43 |
|
44 protected: |
|
45 virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl) MOZ_OVERRIDE; |
|
46 virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE; |
|
47 |
|
48 nsRefPtr<Element> mElement; |
|
49 |
|
50 /* If true, this indicates that this nsDOMCSSAttributeDeclaration |
|
51 * should interact with mContent's SMIL override style rule (rather |
|
52 * than the inline style rule). |
|
53 */ |
|
54 const bool mIsSMILOverride; |
|
55 }; |
|
56 |
|
57 #endif /* nsDOMCSSAttributeDeclaration_h */ |