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/.
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.
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.
20 interface AnonymousContent {
22 * Get the text content of an element inside this custom anonymous content.
25 DOMString getTextContentForElement(DOMString elementId);
28 * Set the text content of an element inside this custom anonymous content.
31 void setTextContentForElement(DOMString elementId, DOMString text);
34 * Get the value of an attribute of an element inside this custom anonymous
38 DOMString? getAttributeForElement(DOMString elementId,
39 DOMString attributeName);
42 * Set the value of an attribute of an element inside this custom anonymous
45 [NeedsSubjectPrincipal=NonSystem, Throws]
46 void setAttributeForElement(DOMString elementId,
47 DOMString attributeName,
51 * Remove an attribute from an element inside this custom anonymous content.
54 void removeAttributeForElement(DOMString elementId,
55 DOMString attributeName);
58 * Get the canvas' context for the element specified if it's a <canvas>
59 * node, `null` otherwise.
62 nsISupports? getCanvasContext(DOMString elementId,
66 Animation setAnimationForElement(DOMString elementId,
68 optional UnrestrictedDoubleOrKeyframeAnimationOptions
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.
78 void setCutoutRectsForElement(DOMString elementId,
79 sequence<DOMRect> rects);
82 * Get the computed value of a property on an element inside this custom
86 DOMString? getComputedStylePropertyValue(DOMString elementId,
87 DOMString propertyName);