Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / dom / webidl / AnonymousContent.webidl
blobc1037ca55fe098789ff56116fc58b70c81ad524a
1 /* -*- Mode: IDL; 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 file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  */
7 /*
8  * This file declares the AnonymousContent interface which is used to
9  * manipulate content that has been inserted into the document's canvasFrame
10  * anonymous container.
11  * See Document.insertAnonymousContent.
12  *
13  * This API never returns a reference to the actual inserted DOM node on
14  * purpose. This is to make sure the content cannot be randomly changed and the
15  * DOM cannot be traversed from the node, so that Gecko can remain in control of
16  * the inserted content.
17  */
19 [ChromeOnly]
20 interface AnonymousContent {
21   /**
22    * Get the text content of an element inside this custom anonymous content.
23    */
24   [Throws]
25   DOMString getTextContentForElement(DOMString elementId);
27   /**
28    * Set the text content of an element inside this custom anonymous content.
29    */
30   [Throws]
31   void setTextContentForElement(DOMString elementId, DOMString text);
33   /**
34    * Get the value of an attribute of an element inside this custom anonymous
35    * content.
36    */
37   [Throws]
38   DOMString? getAttributeForElement(DOMString elementId,
39                                     DOMString attributeName);
41   /**
42    * Set the value of an attribute of an element inside this custom anonymous
43    * content.
44    */
45   [NeedsSubjectPrincipal=NonSystem, Throws]
46   void setAttributeForElement(DOMString elementId,
47                               DOMString attributeName,
48                               DOMString value);
50   /**
51    * Remove an attribute from an element inside this custom anonymous content.
52    */
53   [Throws]
54   void removeAttributeForElement(DOMString elementId,
55                                  DOMString attributeName);
57   /**
58    * Get the canvas' context for the element specified if it's a <canvas>
59    * node, `null` otherwise.
60    */
61   [Throws]
62   nsISupports? getCanvasContext(DOMString elementId,
63                                 DOMString contextId);
65   [Throws]
66   Animation setAnimationForElement(DOMString elementId,
67                                    object? keyframes,
68                                    optional UnrestrictedDoubleOrKeyframeAnimationOptions
69                                      options);
71   /**
72    * Accepts a list of (possibly overlapping) DOMRects which describe a shape
73    * in CSS pixels relative to the element's border box. This shape will be
74    * excluded from the element's background color rendering. The element will
75    * not render any background images once this method has been called.
76    */
77   [Throws]
78   void setCutoutRectsForElement(DOMString elementId,
79                                 sequence<DOMRect> rects);
81   /**
82    * Get the computed value of a property on an element inside this custom
83    * anonymous content.
84    */
85   [Throws]
86   DOMString? getComputedStylePropertyValue(DOMString elementId,
87                                            DOMString propertyName);