/work/obj-fuzz/dist/include/mozilla/dom/AnonymousContent.h
Line | Count | Source (jump to first uncovered line) |
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 | | #ifndef mozilla_dom_AnonymousContent_h |
8 | | #define mozilla_dom_AnonymousContent_h |
9 | | |
10 | | #include "mozilla/dom/Element.h" |
11 | | #include "nsCycleCollectionParticipant.h" |
12 | | #include "nsICSSDeclaration.h" |
13 | | #include "nsIDocument.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | class Element; |
19 | | class UnrestrictedDoubleOrAnonymousKeyframeAnimationOptions; |
20 | | |
21 | | class AnonymousContent final |
22 | | { |
23 | | public: |
24 | | // Ref counting and cycle collection |
25 | | NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnonymousContent) |
26 | | NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(AnonymousContent) |
27 | | |
28 | | explicit AnonymousContent(already_AddRefed<Element> aContentNode); |
29 | | Element& ContentNode() |
30 | 0 | { |
31 | 0 | return *mContentNode; |
32 | 0 | } |
33 | | |
34 | | Element* GetElementById(const nsAString& aElementId); |
35 | | bool WrapObject(JSContext* aCx, |
36 | | JS::Handle<JSObject*> aGivenProto, |
37 | | JS::MutableHandle<JSObject*> aReflector); |
38 | | |
39 | | // WebIDL methods |
40 | | void SetTextContentForElement(const nsAString& aElementId, |
41 | | const nsAString& aText, |
42 | | ErrorResult& aRv); |
43 | | |
44 | | void GetTextContentForElement(const nsAString& aElementId, |
45 | | DOMString& aText, |
46 | | ErrorResult& aRv); |
47 | | |
48 | | void SetAttributeForElement(const nsAString& aElementId, |
49 | | const nsAString& aName, |
50 | | const nsAString& aValue, |
51 | | nsIPrincipal* aSubjectPrincipal, |
52 | | ErrorResult& aRv); |
53 | | |
54 | | void GetAttributeForElement(const nsAString& aElementId, |
55 | | const nsAString& aName, |
56 | | DOMString& aValue, |
57 | | ErrorResult& aRv); |
58 | | |
59 | | void RemoveAttributeForElement(const nsAString& aElementId, |
60 | | const nsAString& aName, |
61 | | ErrorResult& aRv); |
62 | | |
63 | | already_AddRefed<nsISupports> GetCanvasContext(const nsAString& aElementId, |
64 | | const nsAString& aContextId, |
65 | | ErrorResult& aRv); |
66 | | |
67 | | already_AddRefed<Animation> SetAnimationForElement(JSContext* aContext, |
68 | | const nsAString& aElementId, |
69 | | JS::Handle<JSObject*> aKeyframes, |
70 | | const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions, |
71 | | ErrorResult& aError); |
72 | | |
73 | | void SetCutoutRectsForElement(const nsAString& aElementId, |
74 | | const Sequence<OwningNonNull<DOMRect>>& aRects, |
75 | | ErrorResult& aError); |
76 | | |
77 | | void GetComputedStylePropertyValue(const nsAString& aElementId, |
78 | | const nsAString& aPropertyName, |
79 | | DOMString& aResult, |
80 | | ErrorResult& aRv); |
81 | | |
82 | | private: |
83 | | ~AnonymousContent(); |
84 | | RefPtr<Element> mContentNode; |
85 | | }; |
86 | | |
87 | | } // namespace dom |
88 | | } // namespace mozilla |
89 | | |
90 | | #endif // mozilla_dom_AnonymousContent_h |