Line data Source code
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 :
15 : namespace mozilla {
16 : namespace dom {
17 : class Element;
18 : } // namespace dom
19 : } // namespace mozilla
20 :
21 : class nsDOMCSSAttributeDeclaration final : public nsDOMCSSDeclaration
22 : {
23 : public:
24 : typedef mozilla::dom::Element Element;
25 : nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride);
26 :
27 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
28 95 : NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSAttributeDeclaration,
29 : nsICSSDeclaration)
30 :
31 : // If GetCSSDeclaration returns non-null, then the decl it returns
32 : // is owned by our current style rule.
33 : virtual mozilla::DeclarationBlock* GetCSSDeclaration(Operation aOperation) override;
34 : virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) override;
35 : nsDOMCSSDeclaration::ServoCSSParsingEnvironment GetServoCSSParsingEnvironment() const final;
36 : NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) override;
37 :
38 : virtual nsINode* GetParentObject() override;
39 :
40 : NS_IMETHOD SetPropertyValue(const nsCSSPropertyID aPropID,
41 : const nsAString& aValue) override;
42 :
43 : protected:
44 : ~nsDOMCSSAttributeDeclaration();
45 :
46 : virtual nsresult SetCSSDeclaration(mozilla::DeclarationBlock* aDecl) override;
47 : virtual nsIDocument* DocToUpdate() override;
48 :
49 : RefPtr<Element> mElement;
50 :
51 : /* If true, this indicates that this nsDOMCSSAttributeDeclaration
52 : * should interact with mContent's SMIL override style rule (rather
53 : * than the inline style rule).
54 : */
55 : const bool mIsSMILOverride;
56 : };
57 :
58 : #endif /* nsDOMCSSAttributeDeclaration_h */
|