Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / dom / base / AnonymousContent.h
blob406194f89e1be4b34b863465d65d1672033ee443
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/. */
7 #ifndef mozilla_dom_AnonymousContent_h
8 #define mozilla_dom_AnonymousContent_h
10 #include "mozilla/dom/Element.h"
11 #include "mozilla/dom/Event.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "nsICSSDeclaration.h"
14 #include "mozilla/dom/Document.h"
16 namespace mozilla {
17 namespace dom {
19 class Element;
20 class UnrestrictedDoubleOrAnonymousKeyframeAnimationOptions;
22 class AnonymousContent final {
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)
28 explicit AnonymousContent(already_AddRefed<Element> aContentNode);
29 Element& ContentNode() { return *mContentNode; }
31 Element* GetElementById(const nsAString& aElementId);
32 bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
33 JS::MutableHandle<JSObject*> aReflector);
35 // WebIDL methods
36 void SetTextContentForElement(const nsAString& aElementId,
37 const nsAString& aText, ErrorResult& aRv);
39 void GetTextContentForElement(const nsAString& aElementId, DOMString& aText,
40 ErrorResult& aRv);
42 void SetAttributeForElement(const nsAString& aElementId,
43 const nsAString& aName, const nsAString& aValue,
44 nsIPrincipal* aSubjectPrincipal,
45 ErrorResult& aRv);
47 void GetAttributeForElement(const nsAString& aElementId,
48 const nsAString& aName, DOMString& aValue,
49 ErrorResult& aRv);
51 void RemoveAttributeForElement(const nsAString& aElementId,
52 const nsAString& aName, ErrorResult& aRv);
54 already_AddRefed<nsISupports> GetCanvasContext(const nsAString& aElementId,
55 const nsAString& aContextId,
56 ErrorResult& aRv);
58 already_AddRefed<Animation> SetAnimationForElement(
59 JSContext* aContext, const nsAString& aElementId,
60 JS::Handle<JSObject*> aKeyframes,
61 const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
62 ErrorResult& aError);
64 void SetCutoutRectsForElement(const nsAString& aElementId,
65 const Sequence<OwningNonNull<DOMRect>>& aRects,
66 ErrorResult& aError);
68 void GetComputedStylePropertyValue(const nsAString& aElementId,
69 const nsAString& aPropertyName,
70 DOMString& aResult, ErrorResult& aRv);
72 void GetTargetIdForEvent(Event& aEvent, DOMString& aResult);
74 private:
75 ~AnonymousContent();
76 RefPtr<Element> mContentNode;
79 } // namespace dom
80 } // namespace mozilla
82 #endif // mozilla_dom_AnonymousContent_h