1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,1694 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +/** 1.12 + * nsIDOMWindowUtils is intended for infrequently-used methods related 1.13 + * to the current nsIDOMWindow. Some of the methods may require 1.14 + * elevated privileges; the method implementations should contain the 1.15 + * necessary security checks. Access this interface by calling 1.16 + * getInterface on a DOMWindow. 1.17 + */ 1.18 + 1.19 +%{C++ 1.20 +#include "nsColor.h" 1.21 +class gfxContext; 1.22 +class nsRect; 1.23 +%} 1.24 + 1.25 +[ref] native nsConstRect(const nsRect); 1.26 +native nscolor(nscolor); 1.27 +[ptr] native gfxContext(gfxContext); 1.28 +typedef unsigned long long nsViewID; 1.29 + 1.30 +interface nsICycleCollectorListener; 1.31 +interface nsIDOMNode; 1.32 +interface nsIDOMNodeList; 1.33 +interface nsIDOMElement; 1.34 +interface nsIDOMHTMLCanvasElement; 1.35 +interface nsIDOMEvent; 1.36 +interface nsITransferable; 1.37 +interface nsIQueryContentEventResult; 1.38 +interface nsIDOMWindow; 1.39 +interface nsIDOMBlob; 1.40 +interface nsIDOMFile; 1.41 +interface nsIFile; 1.42 +interface nsIDOMClientRect; 1.43 +interface nsIURI; 1.44 +interface nsIDOMEventTarget; 1.45 +interface nsIRunnable; 1.46 +interface nsICompositionStringSynthesizer; 1.47 +interface nsITranslationNodeList; 1.48 + 1.49 +[scriptable, uuid(d4ed34fc-9c07-4cef-b9e1-623794558db3)] 1.50 +interface nsIDOMWindowUtils : nsISupports { 1.51 + 1.52 + /** 1.53 + * Image animation mode of the window. When this attribute's value 1.54 + * is changed, the implementation should set all images in the window 1.55 + * to the given value. That is, when set to kDontAnimMode, all images 1.56 + * will stop animating. The attribute's value must be one of the 1.57 + * animationMode values from imgIContainer. 1.58 + * @note Images may individually override the window's setting after 1.59 + * the window's mode is set. Therefore images given different modes 1.60 + * since the last setting of the window's mode may behave 1.61 + * out of line with the window's overall mode. 1.62 + * @note The attribute's value is the window's overall mode. It may 1.63 + * for example continue to report kDontAnimMode after all images 1.64 + * have subsequently been individually animated. 1.65 + * @note Only images immediately in this window are affected; 1.66 + * this is not recursive to subwindows. 1.67 + * @see imgIContainer 1.68 + */ 1.69 + attribute unsigned short imageAnimationMode; 1.70 + 1.71 + /** 1.72 + * Whether the charset of the window's current document has been forced by 1.73 + * the user. 1.74 + * Cannot be accessed from unprivileged context (not content-accessible) 1.75 + */ 1.76 + readonly attribute boolean docCharsetIsForced; 1.77 + 1.78 + /** 1.79 + * Get current cursor type from this window 1.80 + * @return the current value of nsCursor 1.81 + */ 1.82 + short getCursorType(); 1.83 + 1.84 + /** 1.85 + * Function to get metadata associated with the window's current document 1.86 + * @param aName the name of the metadata. This should be all lowercase. 1.87 + * @return the value of the metadata, or the empty string if it's not set 1.88 + * 1.89 + * Will throw a DOM security error if called without chrome privileges. 1.90 + */ 1.91 + AString getDocumentMetadata(in AString aName); 1.92 + 1.93 + /** 1.94 + * Force an immediate redraw of this window. The parameter specifies 1.95 + * the number of times to redraw, and the return value is the length, 1.96 + * in milliseconds, that the redraws took. If aCount is not specified 1.97 + * or is 0, it is taken to be 1. 1.98 + */ 1.99 + unsigned long redraw([optional] in unsigned long aCount); 1.100 + 1.101 + /** 1.102 + * Set the CSS viewport to be |widthPx| x |heightPx| in units of CSS 1.103 + * pixels, regardless of the size of the enclosing widget/view. 1.104 + * This will trigger reflow. 1.105 + * 1.106 + * The caller of this method must have chrome privileges. 1.107 + */ 1.108 + void setCSSViewport(in float aWidthPx, in float aHeightPx); 1.109 + 1.110 + /** 1.111 + * Information retrieved from the <meta name="viewport"> tag. 1.112 + * See nsContentUtils::GetViewportInfo for more information. 1.113 + */ 1.114 + void getViewportInfo(in uint32_t aDisplayWidth, in uint32_t aDisplayHeight, 1.115 + out double aDefaultZoom, out boolean aAllowZoom, 1.116 + out double aMinZoom, out double aMaxZoom, 1.117 + out uint32_t aWidth, out uint32_t aHeight, 1.118 + out boolean aAutoSize); 1.119 + 1.120 + /** 1.121 + * For any scrollable element, this allows you to override the 1.122 + * visible region and draw more than what is visible, which is 1.123 + * useful for asynchronous drawing. The "displayport" will be 1.124 + * <xPx, yPx, widthPx, heightPx> in units of CSS pixels, 1.125 + * regardless of the size of the enclosing container. This 1.126 + * will *not* trigger reflow. 1.127 + * 1.128 + * For the root scroll area, pass in the root document element. 1.129 + * For scrollable elements, pass in the container element (for 1.130 + * instance, the element with overflow: scroll). 1.131 + * 1.132 + * <x, y> is relative to the top-left of what would normally be 1.133 + * the visible area of the element. This means that the pixels 1.134 + * rendered to the displayport take scrolling into account, 1.135 + * for example. 1.136 + * 1.137 + * It's legal to set a displayport that extends beyond the overflow 1.138 + * area in any direction (left/right/top/bottom). 1.139 + * 1.140 + * It's also legal to set a displayport that extends beyond the 1.141 + * area's bounds. No pixels are rendered outside the area bounds. 1.142 + * 1.143 + * The caller of this method must have chrome privileges. 1.144 + * 1.145 + * Calling this will always force a recomposite, so it should be 1.146 + * avoided if at all possible. Client code should do checks before 1.147 + * calling this so that duplicate sets are not made with the same 1.148 + * displayport. 1.149 + * 1.150 + * aPriority is recorded along with the displayport rectangle. If this 1.151 + * method is called with a lower priority than the current priority, the 1.152 + * call is ignored. 1.153 + */ 1.154 + void setDisplayPortForElement(in float aXPx, in float aYPx, 1.155 + in float aWidthPx, in float aHeightPx, 1.156 + in nsIDOMElement aElement, 1.157 + in uint32_t aPriority); 1.158 + /** 1.159 + * An alternate way to represent a displayport rect as a set of margins and a 1.160 + * base rect to apply those margins to. A consumer of pixels may ask for as 1.161 + * many extra pixels as it would like in each direction. Layout then sets 1.162 + * the base rect to the "visible rect" of the element, which is just the 1.163 + * subrect of the element that is drawn (it does not take in account content 1.164 + * covering the element). 1.165 + * 1.166 + * If both a displayport rect and displayport margins with corresponding base 1.167 + * rect are set with the same priority then the margins will take precendence. 1.168 + * 1.169 + * Specifying an alignment value will ensure that after the base rect has 1.170 + * been expanded by the displayport margins, it will be further expanded so 1.171 + * that each edge is located at a multiple of the "alignment" value. 1.172 + * 1.173 + * Note that both the margin values and alignment are treated as values in 1.174 + * LayerPixels. Refer to layout/base/Units.h for a description of this unit. 1.175 + * The base rect values are in app units. 1.176 + */ 1.177 + void setDisplayPortMarginsForElement(in float aLeftMargin, 1.178 + in float aTopMargin, 1.179 + in float aRightMargin, 1.180 + in float aBottomMargin, 1.181 + in uint32_t aAlignmentX, 1.182 + in uint32_t aAlignmentY, 1.183 + in nsIDOMElement aElement, 1.184 + in uint32_t aPriority); 1.185 + 1.186 + void setDisplayPortBaseForElement(in int32_t aX, 1.187 + in int32_t aY, 1.188 + in int32_t aWidth, 1.189 + in int32_t aHeight, 1.190 + in nsIDOMElement aElement); 1.191 + 1.192 + /** 1.193 + * When a display port is set, this allows a sub-section of that 1.194 + * display port to be marked as 'critical'. In this scenario, the 1.195 + * area outside of this rectangle may be rendered at a lower 1.196 + * detail (for example, by reducing its resolution), or not rendered 1.197 + * at all under some circumstances. 1.198 + * This call will have no effect if a display port has not been set. 1.199 + */ 1.200 + void setCriticalDisplayPortForElement(in float aXPx, in float aYPx, 1.201 + in float aWidthPx, in float aHeightPx, 1.202 + in nsIDOMElement aElement); 1.203 + 1.204 + /** 1.205 + * Get/set the resolution at which rescalable web content is drawn. 1.206 + * Currently this is only (some) thebes content. 1.207 + * 1.208 + * Setting a new resolution does *not* trigger reflow. This API is 1.209 + * entirely separate from textZoom and fullZoom; a resolution scale 1.210 + * can be applied together with both textZoom and fullZoom. 1.211 + * 1.212 + * The effect of is API for gfx code to allocate more or fewer 1.213 + * pixels for rescalable content by a factor of |resolution| in 1.214 + * either or both dimensions. setResolution() together with 1.215 + * setDisplayport() can be used to implement a non-reflowing 1.216 + * scale-zoom in concert with another entity that can draw with a 1.217 + * scale. For example, to scale a content |window| inside a 1.218 + * <browser> by a factor of 2.0 1.219 + * 1.220 + * window.setDisplayport(x, y, oldW / 2.0, oldH / 2.0); 1.221 + * window.setResolution(2.0, 2.0); 1.222 + * // elsewhere 1.223 + * browser.setViewportScale(2.0, 2.0); 1.224 + * 1.225 + * The caller of this method must have chrome privileges. 1.226 + */ 1.227 + void setResolution(in float aXResolution, in float aYResolution); 1.228 + 1.229 + void getResolution(out float aXResolution, out float aYResolution); 1.230 + 1.231 + /** 1.232 + * Whether the resolution has been set by the user. 1.233 + * This gives a way to check whether the provided resolution is the default 1.234 + * value or restored from a previous session. 1.235 + * 1.236 + * Can only be accessed with chrome privileges. 1.237 + */ 1.238 + readonly attribute boolean isResolutionSet; 1.239 + 1.240 + /** 1.241 + * Whether the next paint should be flagged as the first paint for a document. 1.242 + * This gives a way to track the next paint that occurs after the flag is 1.243 + * set. The flag gets cleared after the next paint. 1.244 + * 1.245 + * Can only be accessed with chrome privileges. 1.246 + */ 1.247 + attribute boolean isFirstPaint; 1.248 + 1.249 + void getPresShellId(out uint32_t aPresShellId); 1.250 + 1.251 + /** 1.252 + * Following modifiers are for sent*Event() except sendNative*Event(). 1.253 + * NOTE: MODIFIER_ALT, MODIFIER_CONTROL, MODIFIER_SHIFT and MODIFIER_META 1.254 + * are must be same values as nsIDOMNSEvent::*_MASK for backward 1.255 + * compatibility. 1.256 + */ 1.257 + const long MODIFIER_ALT = 0x0001; 1.258 + const long MODIFIER_CONTROL = 0x0002; 1.259 + const long MODIFIER_SHIFT = 0x0004; 1.260 + const long MODIFIER_META = 0x0008; 1.261 + const long MODIFIER_ALTGRAPH = 0x0010; 1.262 + const long MODIFIER_CAPSLOCK = 0x0020; 1.263 + const long MODIFIER_FN = 0x0040; 1.264 + const long MODIFIER_NUMLOCK = 0x0080; 1.265 + const long MODIFIER_SCROLLLOCK = 0x0100; 1.266 + const long MODIFIER_SYMBOLLOCK = 0x0200; 1.267 + const long MODIFIER_OS = 0x0400; 1.268 + 1.269 + /** Synthesize a mouse event. The event types supported are: 1.270 + * mousedown, mouseup, mousemove, mouseover, mouseout, contextmenu, 1.271 + * MozMouseHitTest 1.272 + * 1.273 + * Events are sent in coordinates offset by aX and aY from the window. 1.274 + * 1.275 + * Note that additional events may be fired as a result of this call. For 1.276 + * instance, typically a click event will be fired as a result of a 1.277 + * mousedown and mouseup in sequence. 1.278 + * 1.279 + * Normally at this level of events, the mouseover and mouseout events are 1.280 + * only fired when the window is entered or exited. For inter-element 1.281 + * mouseover and mouseout events, a movemove event fired on the new element 1.282 + * should be sufficient to generate the correct over and out events as well. 1.283 + * 1.284 + * Cannot be accessed from unprivileged context (not content-accessible) 1.285 + * Will throw a DOM security error if called without chrome privileges. 1.286 + * 1.287 + * The event is dispatched via the toplevel window, so it could go to any 1.288 + * window under the toplevel window, in some cases it could never reach this 1.289 + * window at all. 1.290 + * 1.291 + * @param aType event type 1.292 + * @param aX x offset in CSS pixels 1.293 + * @param aY y offset in CSS pixels 1.294 + * @param aButton button to synthesize 1.295 + * @param aClickCount number of clicks that have been performed 1.296 + * @param aModifiers modifiers pressed, using constants defined as MODIFIER_* 1.297 + * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds 1.298 + * during dispatch 1.299 + * @param aPressure touch input pressure: 0.0 -> 1.0 1.300 + * @param aInputSourceArg input source, see nsIDOMMouseEvent for values, 1.301 + * defaults to mouse input. 1.302 + * @param aIsSynthesized controls nsIDOMEvent.isSynthesized value 1.303 + * that helps identifying test related events, 1.304 + * defaults to true 1.305 + * 1.306 + * returns true if the page called prevent default on this event 1.307 + */ 1.308 + [optional_argc] 1.309 + boolean sendMouseEvent(in AString aType, 1.310 + in float aX, 1.311 + in float aY, 1.312 + in long aButton, 1.313 + in long aClickCount, 1.314 + in long aModifiers, 1.315 + [optional] in boolean aIgnoreRootScrollFrame, 1.316 + [optional] in float aPressure, 1.317 + [optional] in unsigned short aInputSourceArg, 1.318 + [optional] in boolean aIsSynthesized); 1.319 + 1.320 + 1.321 + /** Synthesize a pointer event. The event types supported are: 1.322 + * pointerdown, pointerup, pointermove, pointerover, pointerout 1.323 + * 1.324 + * Events are sent in coordinates offset by aX and aY from the window. 1.325 + * 1.326 + * Note that additional events may be fired as a result of this call. For 1.327 + * instance, typically a click event will be fired as a result of a 1.328 + * mousedown and mouseup in sequence. 1.329 + * 1.330 + * Normally at this level of events, the pointerover and pointerout events are 1.331 + * only fired when the window is entered or exited. For inter-element 1.332 + * pointerover and pointerout events, a movemove event fired on the new element 1.333 + * should be sufficient to generate the correct over and out events as well. 1.334 + * 1.335 + * Cannot be accessed from unprivileged context (not content-accessible) 1.336 + * Will throw a DOM security error if called without chrome privileges. 1.337 + * 1.338 + * The event is dispatched via the toplevel window, so it could go to any 1.339 + * window under the toplevel window, in some cases it could never reach this 1.340 + * window at all. 1.341 + * 1.342 + * @param aType event type 1.343 + * @param aX x offset in CSS pixels 1.344 + * @param aY y offset in CSS pixels 1.345 + * @param aButton button to synthesize 1.346 + * @param aClickCount number of clicks that have been performed 1.347 + * @param aModifiers modifiers pressed, using constants defined as MODIFIER_* 1.348 + * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds 1.349 + * during dispatch 1.350 + * @param aPressure touch input pressure: 0.0 -> 1.0 1.351 + * @param aInputSourceArg input source, see nsIDOMMouseEvent for values, 1.352 + * defaults to mouse input. 1.353 + * @param aPointerId A unique identifier for the pointer causing the event. default is 0 1.354 + * @param aWidth The width (magnitude on the X axis), default is 0 1.355 + * @param aHeight The height (magnitude on the Y axis), default is 0 1.356 + * @param aTilt The plane angle between the Y-Z plane 1.357 + * and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis. default is 0 1.358 + * @param aTiltX The plane angle between the X-Z plane 1.359 + * and the plane containing both the transducer (e.g. pen stylus) axis and the X axis. default is 0 1.360 + * @param aIsPrimary Indicates if the pointer represents the primary pointer of this pointer type. 1.361 + * @param aIsSynthesized controls nsIDOMEvent.isSynthesized value 1.362 + * that helps identifying test related events, 1.363 + * defaults to true 1.364 + * 1.365 + * returns true if the page called prevent default on this event 1.366 + */ 1.367 + 1.368 + [optional_argc] 1.369 + boolean sendPointerEvent(in AString aType, 1.370 + in float aX, 1.371 + in float aY, 1.372 + in long aButton, 1.373 + in long aClickCount, 1.374 + in long aModifiers, 1.375 + [optional] in boolean aIgnoreRootScrollFrame, 1.376 + [optional] in float aPressure, 1.377 + [optional] in unsigned short aInputSourceArg, 1.378 + [optional] in long aPointerId, 1.379 + [optional] in long aWidth, 1.380 + [optional] in long aHeight, 1.381 + [optional] in long tiltX, 1.382 + [optional] in long tiltY, 1.383 + [optional] in boolean aIsPrimary, 1.384 + [optional] in boolean aIsSynthesized); 1.385 + 1.386 + /** Synthesize a touch event. The event types supported are: 1.387 + * touchstart, touchend, touchmove, and touchcancel 1.388 + * 1.389 + * Events are sent in coordinates offset by aX and aY from the window. 1.390 + * 1.391 + * Cannot be accessed from unprivileged context (not content-accessible) 1.392 + * Will throw a DOM security error if called without chrome privileges. 1.393 + * 1.394 + * The event is dispatched via the toplevel window, so it could go to any 1.395 + * window under the toplevel window, in some cases it could never reach this 1.396 + * window at all. 1.397 + * 1.398 + * @param aType event type 1.399 + * @param xs array of offsets in CSS pixels for each touch to be sent 1.400 + * @param ys array of offsets in CSS pixels for each touch to be sent 1.401 + * @param rxs array of radii in CSS pixels for each touch to be sent 1.402 + * @param rys array of radii in CSS pixels for each touch to be sent 1.403 + * @param rotationAngles array of angles in degrees for each touch to be sent 1.404 + * @param forces array of forces (floats from 0 to 1) for each touch to be sent 1.405 + * @param count number of touches in this set 1.406 + * @param aModifiers modifiers pressed, using constants defined as MODIFIER_* 1.407 + * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds 1.408 + * during dispatch 1.409 + * 1.410 + * returns true if the page called prevent default on this touch event 1.411 + */ 1.412 + boolean sendTouchEvent(in AString aType, 1.413 + [array, size_is(count)] in uint32_t aIdentifiers, 1.414 + [array, size_is(count)] in int32_t aXs, 1.415 + [array, size_is(count)] in int32_t aYs, 1.416 + [array, size_is(count)] in uint32_t aRxs, 1.417 + [array, size_is(count)] in uint32_t aRys, 1.418 + [array, size_is(count)] in float aRotationAngles, 1.419 + [array, size_is(count)] in float aForces, 1.420 + in uint32_t count, 1.421 + in long aModifiers, 1.422 + [optional] in boolean aIgnoreRootScrollFrame); 1.423 + 1.424 + /** The same as sendMouseEvent but ensures that the event is dispatched to 1.425 + * this DOM window or one of its children. 1.426 + */ 1.427 + [optional_argc] 1.428 + void sendMouseEventToWindow(in AString aType, 1.429 + in float aX, 1.430 + in float aY, 1.431 + in long aButton, 1.432 + in long aClickCount, 1.433 + in long aModifiers, 1.434 + [optional] in boolean aIgnoreRootScrollFrame, 1.435 + [optional] in float aPressure, 1.436 + [optional] in unsigned short aInputSourceArg, 1.437 + [optional] in boolean aIsSynthesized); 1.438 + 1.439 + /** The same as sendTouchEvent but ensures that the event is dispatched to 1.440 + * this DOM window or one of its children. 1.441 + */ 1.442 + boolean sendTouchEventToWindow(in AString aType, 1.443 + [array, size_is(count)] in uint32_t aIdentifiers, 1.444 + [array, size_is(count)] in int32_t aXs, 1.445 + [array, size_is(count)] in int32_t aYs, 1.446 + [array, size_is(count)] in uint32_t aRxs, 1.447 + [array, size_is(count)] in uint32_t aRys, 1.448 + [array, size_is(count)] in float aRotationAngles, 1.449 + [array, size_is(count)] in float aForces, 1.450 + in uint32_t count, 1.451 + in long aModifiers, 1.452 + [optional] in boolean aIgnoreRootScrollFrame); 1.453 + 1.454 + /** Synthesize a wheel event for a window. The event types supported is only 1.455 + * wheel. 1.456 + * 1.457 + * Events are sent in coordinates offset by aX and aY from the window. 1.458 + * 1.459 + * Cannot be accessed from unprivileged context (not content-accessible) 1.460 + * Will throw a DOM security error if called without chrome privileges. 1.461 + * 1.462 + * @param aX x offset in CSS pixels 1.463 + * @param aY y offset in CSS pixels 1.464 + * @param aDeltaX deltaX value. 1.465 + * @param aDeltaY deltaY value. 1.466 + * @param aDeltaZ deltaZ value. 1.467 + * @param aDeltaMode deltaMode value which must be one of 1.468 + * nsIDOMWheelEvent::DOM_DELTA_*. 1.469 + * @param aModifiers modifiers pressed, using constants defined as 1.470 + * MODIFIER_* 1.471 + * @param aLineOrPageDeltaX If you set this value non-zero for 1.472 + * DOM_DELTA_PIXEL event, EventStateManager will 1.473 + * dispatch NS_MOUSE_SCROLL event for horizontal 1.474 + * scroll. 1.475 + * @param aLineOrPageDeltaY If you set this value non-zero for 1.476 + * DOM_DELTA_PIXEL event, EventStateManager will 1.477 + * dispatch NS_MOUSE_SCROLL event for vertical 1.478 + * scroll. 1.479 + * @param aOptions Set following flags. 1.480 + */ 1.481 + const unsigned long WHEEL_EVENT_CAUSED_BY_PIXEL_ONLY_DEVICE = 0x0001; 1.482 + const unsigned long WHEEL_EVENT_CAUSED_BY_MOMENTUM = 0x0002; 1.483 + const unsigned long WHEEL_EVENT_CUSTOMIZED_BY_USER_PREFS = 0x0004; 1.484 + // If any of the following flags is specified this method will throw an 1.485 + // exception in case the relevant overflowDelta has an unexpected value. 1.486 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_ZERO = 0x0010; 1.487 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_POSITIVE = 0x0020; 1.488 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_NEGATIVE = 0x0040; 1.489 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_ZERO = 0x0100; 1.490 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_POSITIVE = 0x0200; 1.491 + const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_NEGATIVE = 0x0400; 1.492 + void sendWheelEvent(in float aX, 1.493 + in float aY, 1.494 + in double aDeltaX, 1.495 + in double aDeltaY, 1.496 + in double aDeltaZ, 1.497 + in unsigned long aDeltaMode, 1.498 + in long aModifiers, 1.499 + in long aLineOrPageDeltaX, 1.500 + in long aLineOrPageDeltaY, 1.501 + in unsigned long aOptions); 1.502 + 1.503 + /** 1.504 + * Synthesize a key event to the window. The event types supported are: 1.505 + * keydown, keyup, keypress 1.506 + * 1.507 + * Key events generally end up being sent to the focused node. 1.508 + * 1.509 + * Cannot be accessed from unprivileged context (not content-accessible) 1.510 + * Will throw a DOM security error if called without chrome privileges. 1.511 + * 1.512 + * @param aType event type 1.513 + * @param aKeyCode key code 1.514 + * @param aCharCode character code 1.515 + * @param aModifiers modifiers pressed, using constants defined as MODIFIER_* 1.516 + * @param aAdditionalFlags special flags for the key event, see KEY_FLAG_*. 1.517 + * 1.518 + * @return false if the event had preventDefault() called on it, 1.519 + * true otherwise. In other words, true if and only if the 1.520 + * default action was taken. 1.521 + */ 1.522 + 1.523 + // If this is set, preventDefault() the event before dispatch. 1.524 + const unsigned long KEY_FLAG_PREVENT_DEFAULT = 0x0001; 1.525 + 1.526 + // if one of these flags is set, the KeyboardEvent.location will be the value. 1.527 + // Otherwise, it will be computed from aKeyCode. 1.528 + const unsigned long KEY_FLAG_LOCATION_STANDARD = 0x0010; 1.529 + const unsigned long KEY_FLAG_LOCATION_LEFT = 0x0020; 1.530 + const unsigned long KEY_FLAG_LOCATION_RIGHT = 0x0040; 1.531 + const unsigned long KEY_FLAG_LOCATION_NUMPAD = 0x0080; 1.532 + const unsigned long KEY_FLAG_LOCATION_MOBILE = 0x0100; 1.533 + const unsigned long KEY_FLAG_LOCATION_JOYSTICK = 0x0200; 1.534 + 1.535 + boolean sendKeyEvent(in AString aType, 1.536 + in long aKeyCode, 1.537 + in long aCharCode, 1.538 + in long aModifiers, 1.539 + [optional] in unsigned long aAdditionalFlags); 1.540 + 1.541 + /** 1.542 + * See nsIWidget::SynthesizeNativeKeyEvent 1.543 + * 1.544 + * Cannot be accessed from unprivileged context (not content-accessible) 1.545 + * Will throw a DOM security error if called without chrome privileges. 1.546 + * 1.547 + * When you use this for tests, use the constants defined in NativeKeyCodes.js 1.548 + */ 1.549 + void sendNativeKeyEvent(in long aNativeKeyboardLayout, 1.550 + in long aNativeKeyCode, 1.551 + in long aModifierFlags, 1.552 + in AString aCharacters, 1.553 + in AString aUnmodifiedCharacters); 1.554 + 1.555 + /** 1.556 + * See nsIWidget::SynthesizeNativeMouseEvent 1.557 + * 1.558 + * Will be called on the widget that contains aElement. 1.559 + * Cannot be accessed from unprivileged context (not content-accessible) 1.560 + * Will throw a DOM security error if called without chrome privileges. 1.561 + */ 1.562 + void sendNativeMouseEvent(in long aScreenX, 1.563 + in long aScreenY, 1.564 + in long aNativeMessage, 1.565 + in long aModifierFlags, 1.566 + in nsIDOMElement aElement); 1.567 + 1.568 + /** 1.569 + * The values for sendNativeMouseScrollEvent's aAdditionalFlags. 1.570 + */ 1.571 + 1.572 + /** 1.573 + * If MOUSESCROLL_PREFER_WIDGET_AT_POINT is set, widget will dispatch 1.574 + * the event to a widget which is under the cursor. Otherwise, dispatch to 1.575 + * a default target on the platform. E.g., on Windows, it's focused window. 1.576 + */ 1.577 + const unsigned long MOUSESCROLL_PREFER_WIDGET_AT_POINT = 0x00000001; 1.578 + 1.579 + /** 1.580 + * The platform specific values of aAdditionalFlags. Must be over 0x00010000. 1.581 + */ 1.582 + 1.583 + /** 1.584 + * If MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL is set and aNativeMessage is 1.585 + * WM_VSCROLL or WM_HSCROLL, widget will set the window handle to the lParam 1.586 + * instead of NULL. 1.587 + */ 1.588 + const unsigned long MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL = 0x00010000; 1.589 + 1.590 + /** 1.591 + * See nsIWidget::SynthesizeNativeMouseScrollEvent 1.592 + * 1.593 + * Will be called on the widget that contains aElement. 1.594 + * Cannot be accessed from unprivileged context (not content-accessible) 1.595 + * Will throw a DOM security error if called without chrome privileges. 1.596 + * 1.597 + * NOTE: The synthesized native event may be fired asynchronously. 1.598 + * 1.599 + * @param aNativeMessage 1.600 + * On Windows: WM_MOUSEWHEEL (0x020A), WM_MOUSEHWHEEL(0x020E), 1.601 + * WM_VSCROLL (0x0115) or WM_HSCROLL (0x114). 1.602 + */ 1.603 + void sendNativeMouseScrollEvent(in long aScreenX, 1.604 + in long aScreenY, 1.605 + in unsigned long aNativeMessage, 1.606 + in double aDeltaX, 1.607 + in double aDeltaY, 1.608 + in double aDeltaZ, 1.609 + in unsigned long aModifierFlags, 1.610 + in unsigned long aAdditionalFlags, 1.611 + in nsIDOMElement aElement); 1.612 + 1.613 + /** 1.614 + * Touch states for sendNativeTouchPoint. These values match 1.615 + * nsIWidget's TouchPointerState. 1.616 + */ 1.617 + 1.618 + // The pointer is in a hover state above the digitizer 1.619 + const long TOUCH_HOVER = 0x01; 1.620 + // The pointer is in contact with the digitizer 1.621 + const long TOUCH_CONTACT = 0x02; 1.622 + // The pointer has been removed from the digitizer detection area 1.623 + const long TOUCH_REMOVE = 0x04; 1.624 + // The pointer has been canceled. Will cancel any pending os level 1.625 + // gestures that would be triggered as a result of completion of the 1.626 + // input sequence. This may not cancel moz platform related events 1.627 + // that might get tirggered by input already delivered. 1.628 + const long TOUCH_CANCEL = 0x08; 1.629 + 1.630 + /** 1.631 + * Create a new or update an existing touch point on the digitizer. 1.632 + * To trigger os level gestures, individual touch points should 1.633 + * transition through a complete set of touch states which should be 1.634 + * sent as individual calls. For example: 1.635 + * tap - msg1:TOUCH_CONTACT, msg2:TOUCH_REMOVE 1.636 + * drag - msg1-n:TOUCH_CONTACT (moving), msgn+1:TOUCH_REMOVE 1.637 + * hover drag - msg1-n:TOUCH_HOVER (moving), msgn+1:TOUCH_REMOVE 1.638 + * 1.639 + * Widget support: Windows 8.0+, Winrt/Win32. Other widgets will 1.640 + * throw. 1.641 + * 1.642 + * @param aPointerId The touch point id to create or update. 1.643 + * @param aTouchState one or more of the touch states listed above 1.644 + * @param aScreenX, aScreenY screen coords of this event 1.645 + * @param aPressure 0.0 -> 1.0 float val indicating pressure 1.646 + * @param aOrientation 0 -> 359 degree value indicating the 1.647 + * orientation of the pointer. Use 90 for normal taps. 1.648 + */ 1.649 + void sendNativeTouchPoint(in unsigned long aPointerId, 1.650 + in unsigned long aTouchState, 1.651 + in long aScreenX, 1.652 + in long aScreenY, 1.653 + in double aPressure, 1.654 + in unsigned long aOrientation); 1.655 + 1.656 + /** 1.657 + * Simulates native touch based taps on the input digitizer. Events 1.658 + * triggered by this call are injected at the os level. Events do not 1.659 + * bypass widget level input processing and as such can be used to 1.660 + * test widget event logic and async pan-zoom controller functionality. 1.661 + * Cannot be accessed from an unprivileged context. 1.662 + * 1.663 + * Long taps (based on the aLongTap parameter) will be completed 1.664 + * asynchrnously after the call returns. Long tap delay is based on 1.665 + * the ui.click_hold_context_menus.delay pref or 1500 msec if pref 1.666 + * is not set. 1.667 + * 1.668 + * Widget support: Windows 8.0+, Winrt/Win32. Other widgets will 1.669 + * throw. 1.670 + * 1.671 + * @param aScreenX, aScreenY screen coords of this event 1.672 + * @param aLongTap true if the tap should be long, false for a short 1.673 + * tap. 1.674 + */ 1.675 + void sendNativeTouchTap(in long aScreenX, 1.676 + in long aScreenY, 1.677 + in boolean aLongTap); 1.678 + 1.679 + /** 1.680 + * Cancel any existing touch points or long tap delays. Calling this is safe 1.681 + * even if you're sure there aren't any pointers recorded. You should call 1.682 + * this when tests shut down to reset the digitizer driver. Not doing so can 1.683 + * leave the digitizer in an undetermined state which can screw up subsequent 1.684 + * tests and native input. 1.685 + */ 1.686 + void clearNativeTouchSequence(); 1.687 + 1.688 + /** 1.689 + * See nsIWidget::ActivateNativeMenuItemAt 1.690 + * 1.691 + * Cannot be accessed from unprivileged context (not content-accessible) 1.692 + * Will throw a DOM security error if called without chrome privileges. 1.693 + */ 1.694 + void activateNativeMenuItemAt(in AString indexString); 1.695 + 1.696 + /** 1.697 + * See nsIWidget::ForceUpdateNativeMenuAt 1.698 + * 1.699 + * Cannot be accessed from unprivileged context (not content-accessible) 1.700 + * Will throw a DOM security error if called without chrome privileges. 1.701 + */ 1.702 + void forceUpdateNativeMenuAt(in AString indexString); 1.703 + 1.704 + /** 1.705 + * Focus the element aElement. The element should be in the same document 1.706 + * that the window is displaying. Pass null to blur the element, if any, 1.707 + * that currently has focus, and focus the document. 1.708 + * 1.709 + * Cannot be accessed from unprivileged context (not content-accessible) 1.710 + * Will throw a DOM security error if called without chrome privileges. 1.711 + * 1.712 + * @param aElement the element to focus 1.713 + * 1.714 + * Do not use this method. Just use element.focus if available or 1.715 + * nsIFocusManager::SetFocus instead. 1.716 + * 1.717 + */ 1.718 + void focus(in nsIDOMElement aElement); 1.719 + 1.720 + /** 1.721 + * Force a garbage collection followed by a cycle collection. 1.722 + * 1.723 + * Will throw a DOM security error if called without chrome privileges in 1.724 + * non-debug builds. Available to all callers in debug builds. 1.725 + * 1.726 + * @param aListener listener that receives information about the CC graph 1.727 + * (see @mozilla.org/cycle-collector-logger;1 for a logger 1.728 + * component) 1.729 + * @param aExtraForgetSkippableCalls indicates how many times 1.730 + * nsCycleCollector_forgetSkippable will 1.731 + * be called before running cycle collection. 1.732 + * -1 prevents the default 1.733 + * nsCycleCollector_forgetSkippable call 1.734 + * which happens after garbage collection. 1.735 + */ 1.736 + void garbageCollect([optional] in nsICycleCollectorListener aListener, 1.737 + [optional] in long aExtraForgetSkippableCalls); 1.738 + 1.739 + /** 1.740 + * Force a cycle collection without garbage collection. 1.741 + * 1.742 + * Will throw a DOM security error if called without chrome privileges in 1.743 + * non-debug builds. Available to all callers in debug builds. 1.744 + * 1.745 + * @param aListener listener that receives information about the CC graph 1.746 + * (see @mozilla.org/cycle-collector-logger;1 for a logger 1.747 + * component) 1.748 + * @param aExtraForgetSkippableCalls indicates how many times 1.749 + * nsCycleCollector_forgetSkippable will 1.750 + * be called before running cycle collection. 1.751 + * -1 prevents the default 1.752 + * nsCycleCollector_forgetSkippable call 1.753 + * which happens after garbage collection. 1.754 + */ 1.755 + void cycleCollect([optional] in nsICycleCollectorListener aListener, 1.756 + [optional] in long aExtraForgetSkippableCalls); 1.757 + 1.758 + /** 1.759 + * Trigger whichever GC or CC timer is currently active and waiting to fire. 1.760 + * Don't do this too much for initiating heavy actions, like the start of a IGC. 1.761 + */ 1.762 + void runNextCollectorTimer(); 1.763 + 1.764 + /** Synthesize a simple gesture event for a window. The event types 1.765 + * supported are: MozSwipeGestureStart, MozSwipeGestureUpdate, 1.766 + * MozSwipeGestureEnd, MozSwipeGesture, MozMagnifyGestureStart, 1.767 + * MozMagnifyGestureUpdate, MozMagnifyGesture, MozRotateGestureStart, 1.768 + * MozRotateGestureUpdate, MozRotateGesture, MozPressTapGesture, 1.769 + * MozTapGesture, and MozEdgeUIGesture. 1.770 + * 1.771 + * Cannot be accessed from unprivileged context (not 1.772 + * content-accessible) Will throw a DOM security error if called 1.773 + * without chrome privileges. 1.774 + * 1.775 + * @param aType event type 1.776 + * @param aX x offset in CSS pixels 1.777 + * @param aY y offset in CSS pixels 1.778 + * @param aDirection direction, using constants defined in nsIDOMSimpleGestureEvent 1.779 + * @param aDelta amount of magnification or rotation for magnify and rotation events 1.780 + * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent 1.781 + * @param aClickCount For tap gestures, the number of taps. 1.782 + */ 1.783 + void sendSimpleGestureEvent(in AString aType, 1.784 + in float aX, 1.785 + in float aY, 1.786 + in unsigned long aDirection, 1.787 + in double aDelta, 1.788 + in long aModifiers, 1.789 + [optional] in unsigned long aClickCount); 1.790 + 1.791 + /** 1.792 + * Retrieve the element at point aX, aY in the window's document. 1.793 + * 1.794 + * @param aIgnoreRootScrollFrame whether or not to ignore the root scroll 1.795 + * frame when retrieving the element. If false, this method returns 1.796 + * null for coordinates outside of the viewport. 1.797 + * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. 1.798 + */ 1.799 + nsIDOMElement elementFromPoint(in float aX, 1.800 + in float aY, 1.801 + in boolean aIgnoreRootScrollFrame, 1.802 + in boolean aFlushLayout); 1.803 + 1.804 + /** 1.805 + * Retrieve all nodes that intersect a rect in the window's document. 1.806 + * 1.807 + * @param aX x reference for the rectangle in CSS pixels 1.808 + * @param aY y reference for the rectangle in CSS pixels 1.809 + * @param aTopSize How much to expand up the rectangle 1.810 + * @param aRightSize How much to expand right the rectangle 1.811 + * @param aBottomSize How much to expand down the rectangle 1.812 + * @param aLeftSize How much to expand left the rectangle 1.813 + * @param aIgnoreRootScrollFrame whether or not to ignore the root scroll 1.814 + * frame when retrieving the element. If false, this method returns 1.815 + * null for coordinates outside of the viewport. 1.816 + * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. 1.817 + */ 1.818 + nsIDOMNodeList nodesFromRect(in float aX, 1.819 + in float aY, 1.820 + in float aTopSize, 1.821 + in float aRightSize, 1.822 + in float aBottomSize, 1.823 + in float aLeftSize, 1.824 + in boolean aIgnoreRootScrollFrame, 1.825 + in boolean aFlushLayout); 1.826 + 1.827 + 1.828 + /** 1.829 + * Get a list of nodes that have meaningful textual content to 1.830 + * be translated. The implementation of this algorithm is in flux 1.831 + * as we experiment and refine which approach works best. 1.832 + * 1.833 + * This method requires chrome privileges. 1.834 + */ 1.835 + nsITranslationNodeList getTranslationNodes(in nsIDOMNode aRoot); 1.836 + 1.837 + /** 1.838 + * Compare the two canvases, returning the number of differing pixels and 1.839 + * the maximum difference in a channel. This will throw an error if 1.840 + * the dimensions of the two canvases are different. 1.841 + * 1.842 + * This method requires chrome privileges. 1.843 + */ 1.844 + uint32_t compareCanvases(in nsIDOMHTMLCanvasElement aCanvas1, 1.845 + in nsIDOMHTMLCanvasElement aCanvas2, 1.846 + out unsigned long aMaxDifference); 1.847 + 1.848 + /** 1.849 + * Returns true if a MozAfterPaint event has been queued but not yet 1.850 + * fired. 1.851 + */ 1.852 + readonly attribute boolean isMozAfterPaintPending; 1.853 + 1.854 + /** 1.855 + * Suppresses/unsuppresses user initiated event handling in window's document 1.856 + * and subdocuments. 1.857 + * 1.858 + * @throw NS_ERROR_DOM_SECURITY_ERR if called without chrome privileges and 1.859 + * NS_ERROR_FAILURE if window doesn't have a document. 1.860 + */ 1.861 + void suppressEventHandling(in boolean aSuppress); 1.862 + 1.863 + void clearMozAfterPaintEvents(); 1.864 + 1.865 + /** 1.866 + * Disable or enable non synthetic test mouse events on *all* windows. 1.867 + * 1.868 + * Cannot be accessed from unprivileged context (not content-accessible). 1.869 + * Will throw a DOM security error if called without chrome privileges. 1.870 + * 1.871 + * @param aDisable If true, disable all non synthetic test mouse events 1.872 + * on all windows. Otherwise, enable them. 1.873 + */ 1.874 + void disableNonTestMouseEvents(in boolean aDisable); 1.875 + 1.876 + /** 1.877 + * Returns the scroll position of the window's currently loaded document. 1.878 + * 1.879 + * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. 1.880 + * @see nsIDOMWindow::scrollX/Y 1.881 + */ 1.882 + void getScrollXY(in boolean aFlushLayout, out long aScrollX, out long aScrollY); 1.883 + 1.884 + /** 1.885 + * Returns the scroll position of the window's currently loaded document. 1.886 + * 1.887 + * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. 1.888 + * @see nsIDOMWindow::scrollX/Y 1.889 + */ 1.890 + void getScrollXYFloat(in boolean aFlushLayout, out float aScrollX, out float aScrollY); 1.891 + 1.892 + /** 1.893 + * Returns the scrollbar width of the window's scroll frame. 1.894 + * 1.895 + * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. 1.896 + */ 1.897 + void getScrollbarSize(in boolean aFlushLayout, out long aWidth, out long aHeight); 1.898 + 1.899 + /** 1.900 + * Returns the given element's bounds without flushing pending layout changes. 1.901 + */ 1.902 + nsIDOMClientRect getBoundsWithoutFlushing(in nsIDOMElement aElement); 1.903 + 1.904 + /** 1.905 + * Returns the bounds of the window's currently loaded document. This will 1.906 + * generally be (0, 0, pageWidth, pageHeight) but in some cases (e.g. RTL 1.907 + * documents) may have a negative left value. 1.908 + */ 1.909 + nsIDOMClientRect getRootBounds(); 1.910 + 1.911 + /** 1.912 + * Get IME open state. TRUE means 'Open', otherwise, 'Close'. 1.913 + * This property works only when IMEEnabled is IME_STATUS_ENABLED. 1.914 + */ 1.915 + readonly attribute boolean IMEIsOpen; 1.916 + 1.917 + /** 1.918 + * WARNING: These values must be same as nsIWidget's values. 1.919 + */ 1.920 + 1.921 + /** 1.922 + * DISABLED means users cannot use IME completely. 1.923 + * Note that this state is *not* same as |ime-mode: disabled;|. 1.924 + */ 1.925 + const unsigned long IME_STATUS_DISABLED = 0; 1.926 + 1.927 + /** 1.928 + * ENABLED means users can use all functions of IME. This state is same as 1.929 + * |ime-mode: normal;|. 1.930 + */ 1.931 + const unsigned long IME_STATUS_ENABLED = 1; 1.932 + 1.933 + /** 1.934 + * PASSWORD means users cannot use most functions of IME. But on GTK2, 1.935 + * users can use "Simple IM" which only supports dead key inputting. 1.936 + * The behavior is same as the behavior of the native password field. 1.937 + * This state is same as |ime-mode: disabled;|. 1.938 + */ 1.939 + const unsigned long IME_STATUS_PASSWORD = 2; 1.940 + 1.941 + /** 1.942 + * PLUGIN means a plug-in has focus. At this time we should not touch to 1.943 + * controlling the IME state. 1.944 + */ 1.945 + const unsigned long IME_STATUS_PLUGIN = 3; 1.946 + 1.947 + /** 1.948 + * Get IME status, see above IME_STATUS_* definitions. 1.949 + */ 1.950 + readonly attribute unsigned long IMEStatus; 1.951 + 1.952 + /** 1.953 + * Get the number of screen pixels per CSS pixel. 1.954 + */ 1.955 + readonly attribute float screenPixelsPerCSSPixel; 1.956 + 1.957 + /** 1.958 + * Get the current zoom factor. 1.959 + * This is _approximately_ the same as nsIMarkupDocumentViewer.fullZoom, 1.960 + * but takes into account Gecko's quantization of the zoom factor, which is 1.961 + * implemented by adjusting the (integer) number of appUnits per devPixel. 1.962 + */ 1.963 + readonly attribute float fullZoom; 1.964 + 1.965 + /** 1.966 + * Dispatches aEvent via the nsIPresShell object of the window's document. 1.967 + * The event is dispatched to aTarget, which should be an object 1.968 + * which implements nsIContent interface (#element, #text, etc). 1.969 + * 1.970 + * Cannot be accessed from unprivileged context (not 1.971 + * content-accessible) Will throw a DOM security error if called 1.972 + * without chrome privileges. 1.973 + * 1.974 + * @note Event handlers won't get aEvent as parameter, but a similar event. 1.975 + * Also, aEvent should not be reused. 1.976 + */ 1.977 + boolean dispatchDOMEventViaPresShell(in nsIDOMNode aTarget, 1.978 + in nsIDOMEvent aEvent, 1.979 + in boolean aTrusted); 1.980 + 1.981 + /** 1.982 + * Sets WidgetEvent::mFlags::mOnlyChromeDispatch to true to ensure that 1.983 + * the event is propagated only to chrome. 1.984 + * Event's .target property will be aTarget. 1.985 + * Returns the same value as what EventTarget.dispatchEvent does. 1.986 + */ 1.987 + boolean dispatchEventToChromeOnly(in nsIDOMEventTarget aTarget, 1.988 + in nsIDOMEvent aEvent); 1.989 + 1.990 + /** 1.991 + * Returns the real classname (possibly of the mostly-transparent security 1.992 + * wrapper) of aObj. 1.993 + */ 1.994 + [implicit_jscontext] string getClassName(in jsval aObject); 1.995 + 1.996 + /** 1.997 + * Generate a content command event. 1.998 + * 1.999 + * Cannot be accessed from unprivileged context (not content-accessible) 1.1000 + * Will throw a DOM security error if called without chrome privileges. 1.1001 + * 1.1002 + * @param aType Type of command content event to send. Can be one of "cut", 1.1003 + * "copy", "paste", "delete", "undo", "redo", or "pasteTransferable". 1.1004 + * @param aTransferable an instance of nsITransferable when aType is 1.1005 + * "pasteTransferable" 1.1006 + */ 1.1007 + void sendContentCommandEvent(in AString aType, 1.1008 + [optional] in nsITransferable aTransferable); 1.1009 + 1.1010 + /** 1.1011 + * Synthesize a composition event to the window. 1.1012 + * 1.1013 + * Cannot be accessed from unprivileged context (not content-accessible) 1.1014 + * Will throw a DOM security error if called without chrome privileges. 1.1015 + * 1.1016 + * @param aType The event type: "compositionstart", "compositionend" or 1.1017 + * "compositionupdate". 1.1018 + * @param aData The data property value. Note that this isn't applied 1.1019 + * for compositionstart event because its value is the 1.1020 + * selected text which is automatically computed. 1.1021 + * @param aLocale The locale property value. 1.1022 + */ 1.1023 + void sendCompositionEvent(in AString aType, 1.1024 + in AString aData, 1.1025 + in AString aLocale); 1.1026 + 1.1027 + /** 1.1028 + * Creating synthesizer of composition string on the window. 1.1029 + * 1.1030 + * Cannot be accessed from unprivileged context (not content-accessible) 1.1031 + * Will throw a DOM security error if called without chrome privileges. 1.1032 + */ 1.1033 + nsICompositionStringSynthesizer createCompositionStringSynthesizer(); 1.1034 + 1.1035 + /** 1.1036 + * If sendQueryContentEvent()'s aAdditionalFlags argument is 1.1037 + * QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK, plain text generated from content 1.1038 + * is created with "\n". 1.1039 + * Otherwise, platform dependent. E.g., on Windows, "\r\n" is used. 1.1040 + * aOffset and aLength are offset and length in/of the plain text content. 1.1041 + * This flag also affects the result values such as offset, length and string. 1.1042 + */ 1.1043 + const unsigned long QUERY_CONTENT_FLAG_USE_NATIVE_LINE_BREAK = 0x0000; 1.1044 + const unsigned long QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK = 0x0001; 1.1045 + 1.1046 + /** 1.1047 + * Synthesize a query content event. Note that the result value returned here 1.1048 + * is in LayoutDevice pixels rather than CSS pixels. 1.1049 + * 1.1050 + * @param aType One of the following const values. And see also each comment 1.1051 + * for the other parameters and the result. 1.1052 + * @param aAdditionalFlags See the description of QUERY_CONTENT_FLAG_*. 1.1053 + */ 1.1054 + nsIQueryContentEventResult sendQueryContentEvent( 1.1055 + in unsigned long aType, 1.1056 + in unsigned long aOffset, 1.1057 + in unsigned long aLength, 1.1058 + in long aX, 1.1059 + in long aY, 1.1060 + [optional] in unsigned long aAdditionalFlags); 1.1061 + 1.1062 + // NOTE: following values are same as NS_QUERY_* in BasicEvents.h 1.1063 + 1.1064 + /** 1.1065 + * QUERY_SELECTED_TEXT queries the first selection range's information. 1.1066 + * 1.1067 + * @param aOffset Not used. 1.1068 + * @param aLength Not used. 1.1069 + * @param aX Not used. 1.1070 + * @param aY Not used. 1.1071 + * 1.1072 + * @return offset, reversed and text properties of the result are available. 1.1073 + */ 1.1074 + const unsigned long QUERY_SELECTED_TEXT = 3200; 1.1075 + 1.1076 + /** 1.1077 + * QUERY_TEXT_CONTENT queries the text at the specified range. 1.1078 + * 1.1079 + * @param aOffset The first character's offset. 0 is the first character. 1.1080 + * @param aLength The length of getting text. If the aLength is too long, 1.1081 + * the result text is shorter than this value. 1.1082 + * @param aX Not used. 1.1083 + * @param aY Not used. 1.1084 + * 1.1085 + * @return text property of the result is available. 1.1086 + */ 1.1087 + const unsigned long QUERY_TEXT_CONTENT = 3201; 1.1088 + 1.1089 + /** 1.1090 + * QUERY_CARET_RECT queries the (collapsed) caret rect of the offset. 1.1091 + * If the actual caret is there at the specified offset, this returns the 1.1092 + * actual caret rect. Otherwise, this guesses the caret rect from the 1.1093 + * metrics of the text. 1.1094 + * 1.1095 + * @param aOffset The caret offset. 0 is the left side of the first 1.1096 + * caracter in LTR text. 1.1097 + * @param aLength Not used. 1.1098 + * @param aX Not used. 1.1099 + * @param aY Not used. 1.1100 + * 1.1101 + * @return left, top, width and height properties of the result are available. 1.1102 + * The left and the top properties are offset in the client area of 1.1103 + * the DOM window. 1.1104 + */ 1.1105 + const unsigned long QUERY_CARET_RECT = 3203; 1.1106 + 1.1107 + /** 1.1108 + * QUERY_TEXT_RECT queries the specified text's rect. 1.1109 + * 1.1110 + * @param aOffset The first character's offset. 0 is the first character. 1.1111 + * @param aLength The length of getting text. If the aLength is too long, 1.1112 + * the extra length is ignored. 1.1113 + * @param aX Not used. 1.1114 + * @param aY Not used. 1.1115 + * 1.1116 + * @return left, top, width and height properties of the result are available. 1.1117 + * The left and the top properties are offset in the client area of 1.1118 + * the DOM window. 1.1119 + */ 1.1120 + const unsigned long QUERY_TEXT_RECT = 3204; 1.1121 + 1.1122 + /** 1.1123 + * QUERY_TEXT_RECT queries the focused editor's rect. 1.1124 + * 1.1125 + * @param aOffset Not used. 1.1126 + * @param aLength Not used. 1.1127 + * @param aX Not used. 1.1128 + * @param aY Not used. 1.1129 + * 1.1130 + * @return left, top, width and height properties of the result are available. 1.1131 + */ 1.1132 + const unsigned long QUERY_EDITOR_RECT = 3205; 1.1133 + 1.1134 + /** 1.1135 + * QUERY_CHARACTER_AT_POINT queries the character information at the 1.1136 + * specified point. The point is offset in the window. 1.1137 + * NOTE: If there are some panels at the point, this method send the query 1.1138 + * event to the panel's widget automatically. 1.1139 + * 1.1140 + * @param aOffset Not used. 1.1141 + * @param aLength Not used. 1.1142 + * @param aX X offset in the widget. 1.1143 + * @param aY Y offset in the widget. 1.1144 + * 1.1145 + * @return offset, notFound, left, top, width and height properties of the 1.1146 + * result are available. 1.1147 + */ 1.1148 + const unsigned long QUERY_CHARACTER_AT_POINT = 3208; 1.1149 + 1.1150 + /** 1.1151 + * Called when the remote child frame has changed its fullscreen state, 1.1152 + * when entering fullscreen, and when the origin which is fullscreen changes. 1.1153 + * aFrameElement is the iframe element which contains the child-process 1.1154 + * fullscreen document, and aNewOrigin is the origin of the new fullscreen 1.1155 + * document. 1.1156 + */ 1.1157 + void remoteFrameFullscreenChanged(in nsIDOMElement aFrameElement, 1.1158 + in AString aNewOrigin); 1.1159 + 1.1160 + /** 1.1161 + * Called when the remote frame has popped all fullscreen elements off its 1.1162 + * stack, so that the operation can complete on the parent side. 1.1163 + */ 1.1164 + void remoteFrameFullscreenReverted(); 1.1165 + 1.1166 + /** 1.1167 + * Called when the child frame has fully exit fullscreen, so that the parent 1.1168 + * process can also fully exit. 1.1169 + */ 1.1170 + void exitFullscreen(); 1.1171 + 1.1172 + /** 1.1173 + * If sendQueryContentEvent()'s aAdditionalFlags argument is 1.1174 + * SELECTION_SET_FLAG_USE_NATIVE_LINE_BREAK, aOffset and aLength are offset 1.1175 + * and length in/of plain text generated from content is created with "\n". 1.1176 + * Otherwise, platform dependent. E.g., on Windows, "\r\n" is used. 1.1177 + */ 1.1178 + const unsigned long SELECTION_SET_FLAG_USE_NATIVE_LINE_BREAK = 0x0000; 1.1179 + const unsigned long SELECTION_SET_FLAG_USE_XP_LINE_BREAK = 0x0001; 1.1180 + 1.1181 + /** 1.1182 + * If SELECTION_SET_FLAG_REVERSE is set, the selection is set from 1.1183 + * |aOffset + aLength| to |aOffset|. Otherwise, it's set from |aOffset| to 1.1184 + * |aOffset + aLength|. 1.1185 + */ 1.1186 + const unsigned long SELECTION_SET_FLAG_REVERSE = 0x0002; 1.1187 + 1.1188 + /** 1.1189 + * Synthesize a selection set event to the window. 1.1190 + * 1.1191 + * This sets the selection as the specified information. 1.1192 + * 1.1193 + * @param aOffset The caret offset of the selection start. 1.1194 + * @param aLength The length of the selection. If this is too long, the 1.1195 + * extra length is ignored. 1.1196 + * @param aAdditionalFlags See the description of SELECTION_SET_FLAG_*. 1.1197 + * @return True, if succeeded. Otherwise, false. 1.1198 + */ 1.1199 + boolean sendSelectionSetEvent(in unsigned long aOffset, 1.1200 + in unsigned long aLength, 1.1201 + [optional] in unsigned long aAdditionalFlags); 1.1202 + 1.1203 + /* Selection behaviors - mirror nsIFrame's nsSelectionAmount constants */ 1.1204 + const unsigned long SELECT_CHARACTER = 0; 1.1205 + const unsigned long SELECT_CLUSTER = 1; 1.1206 + const unsigned long SELECT_WORD = 2; 1.1207 + const unsigned long SELECT_LINE = 3; 1.1208 + const unsigned long SELECT_BEGINLINE = 4; 1.1209 + const unsigned long SELECT_ENDLINE = 5; 1.1210 + const unsigned long SELECT_PARAGRAPH = 6; 1.1211 + const unsigned long SELECT_WORDNOSPACE = 7; 1.1212 + 1.1213 + /** 1.1214 + * Select content at a client point based on a selection behavior if the 1.1215 + * underlying content is selectable. Selection will accumulate with any 1.1216 + * existing selection, callers should clear selection prior if needed. 1.1217 + * May fire selection changed events. Calls nsFrame's SelectByTypeAtPoint. 1.1218 + * 1.1219 + * @param aX, aY The selection point in client coordinates. 1.1220 + * @param aSelectType The selection behavior requested. 1.1221 + * @return True if a selection occured, false otherwise. 1.1222 + * @throw NS_ERROR_DOM_SECURITY_ERR, NS_ERROR_UNEXPECTED for utils 1.1223 + * issues, and NS_ERROR_INVALID_ARG for coordinates that are outside 1.1224 + * this window. 1.1225 + */ 1.1226 + boolean selectAtPoint(in float aX, 1.1227 + in float aY, 1.1228 + in unsigned long aSelectBehavior); 1.1229 + 1.1230 + /** 1.1231 + * Perform the equivalent of: 1.1232 + * window.getComputedStyle(aElement, aPseudoElement). 1.1233 + * getPropertyValue(aPropertyName) 1.1234 + * except that, when the link whose presence in history is allowed to 1.1235 + * influence aElement's style is visited, get the value the property 1.1236 + * would have if allowed all properties to change as a result of 1.1237 + * :visited selectors (except for cases where getComputedStyle uses 1.1238 + * data from the frame). 1.1239 + * 1.1240 + * This is easier to implement than adding our property restrictions 1.1241 + * to this API, and is sufficient for the present testing 1.1242 + * requirements (which are essentially testing 'color'). 1.1243 + */ 1.1244 + AString getVisitedDependentComputedStyle(in nsIDOMElement aElement, 1.1245 + in AString aPseudoElement, 1.1246 + in AString aPropertyName); 1.1247 + 1.1248 + /** 1.1249 + * Returns the parent of obj. 1.1250 + * 1.1251 + * @param obj The JavaScript object whose parent is to be gotten. 1.1252 + * @return the parent. 1.1253 + */ 1.1254 + [implicit_jscontext] jsval getParent(in jsval obj); 1.1255 + 1.1256 + /** 1.1257 + * Get the id of the outer window of this window. This will never throw. 1.1258 + */ 1.1259 + readonly attribute unsigned long long outerWindowID; 1.1260 + 1.1261 + /** 1.1262 + * Get the id of the current inner window of this window. If there 1.1263 + * is no current inner window, throws NS_ERROR_NOT_AVAILABLE. 1.1264 + */ 1.1265 + readonly attribute unsigned long long currentInnerWindowID; 1.1266 + 1.1267 + /** 1.1268 + * Put the window into a state where scripts are frozen and events 1.1269 + * suppressed, for use when the window has launched a modal prompt. 1.1270 + */ 1.1271 + void enterModalState(); 1.1272 + 1.1273 + /** 1.1274 + * Resume normal window state, where scripts can run and events are 1.1275 + * delivered. 1.1276 + */ 1.1277 + void leaveModalState(); 1.1278 + 1.1279 + /** 1.1280 + * Is the window is in a modal state? [See enterModalState()] 1.1281 + */ 1.1282 + [noscript] boolean isInModalState(); 1.1283 + 1.1284 + /** 1.1285 + * Suspend/resume timeouts on this window and its descendant windows. 1.1286 + */ 1.1287 + void suspendTimeouts(); 1.1288 + void resumeTimeouts(); 1.1289 + 1.1290 + /** 1.1291 + * What type of layer manager the widget associated with this window is 1.1292 + * using. "Basic" is unaccelerated; other types are accelerated. Throws an 1.1293 + * error if there is no widget associated with this window. 1.1294 + */ 1.1295 + readonly attribute AString layerManagerType; 1.1296 + 1.1297 + /** 1.1298 + * True if the layer manager for the widget associated with this window is 1.1299 + * forwarding layers to a remote compositor, false otherwise. Throws an 1.1300 + * error if there is no widget associated with this window. 1.1301 + */ 1.1302 + readonly attribute boolean layerManagerRemote; 1.1303 + 1.1304 + /** 1.1305 + * Record (and return) frame-intervals for frames which were presented 1.1306 + * between calling StartFrameTimeRecording and StopFrameTimeRecording. 1.1307 + * 1.1308 + * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late 1.1309 + * (elements were overwritten since Start), result is considered invalid and hence empty. 1.1310 + * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent). 1.1311 + * Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize. 1.1312 + * - Note: the first frame-interval may be longer than expected because last frame 1.1313 + * might have been presented some time before calling StartFrameTimeRecording. 1.1314 + */ 1.1315 + 1.1316 + /** 1.1317 + * Returns a handle which represents current recording start position. 1.1318 + */ 1.1319 + void startFrameTimeRecording([retval] out unsigned long startIndex); 1.1320 + 1.1321 + /** 1.1322 + * Returns number of recorded frames since startIndex was issued, 1.1323 + * and allocates+populates 2 arraye with the recorded data. 1.1324 + * - Allocation is infallible. Should be released even if size is 0. 1.1325 + */ 1.1326 + void stopFrameTimeRecording(in unsigned long startIndex, 1.1327 + [optional] out unsigned long frameCount, 1.1328 + [retval, array, size_is(frameCount)] out float frameIntervals); 1.1329 + 1.1330 + /** 1.1331 + * Signals that we're begining to tab switch. This is used by painting code to 1.1332 + * determine total tab switch time. 1.1333 + */ 1.1334 + void beginTabSwitch(); 1.1335 + 1.1336 + /** 1.1337 + * The DPI of the display 1.1338 + */ 1.1339 + readonly attribute float displayDPI; 1.1340 + 1.1341 + /** 1.1342 + * Return the outer window with the given ID, if any. Can return null. 1.1343 + * @deprecated Use nsIWindowMediator.getOuterWindowWithId. See bug 865664. 1.1344 + */ 1.1345 + nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID); 1.1346 + 1.1347 + /** 1.1348 + * Return this window's frame element. 1.1349 + * Ignores all chrome/content or mozbrowser boundaries. 1.1350 + */ 1.1351 + readonly attribute nsIDOMElement containerElement; 1.1352 + 1.1353 + [noscript] void RenderDocument(in nsConstRect aRect, 1.1354 + in uint32_t aFlags, 1.1355 + in nscolor aBackgroundColor, 1.1356 + in gfxContext aThebesContext); 1.1357 + 1.1358 + /** 1.1359 + * advanceTimeAndRefresh allows the caller to take over the refresh 1.1360 + * driver timing for a window. A call to advanceTimeAndRefresh does 1.1361 + * three things: 1.1362 + * (1) It marks the refresh driver for this presentation so that it 1.1363 + * no longer refreshes on its own, but is instead driven entirely 1.1364 + * by the caller (except for the refresh that happens when a 1.1365 + * document comes out of the bfcache). 1.1366 + * (2) It advances the refresh driver's current refresh time by the 1.1367 + * argument given. Negative advances are permitted. 1.1368 + * (3) It does a refresh (i.e., notifies refresh observers) at that 1.1369 + * new time. 1.1370 + * 1.1371 + * Note that this affects other connected docshells of the same type 1.1372 + * in the same docshell tree, such as parent frames. 1.1373 + * 1.1374 + * When callers have completed their use of advanceTimeAndRefresh, 1.1375 + * they must call restoreNormalRefresh. 1.1376 + */ 1.1377 + void advanceTimeAndRefresh(in long long aMilliseconds); 1.1378 + 1.1379 + /** 1.1380 + * Undoes the effects of advanceTimeAndRefresh. 1.1381 + */ 1.1382 + void restoreNormalRefresh(); 1.1383 + 1.1384 + /** 1.1385 + * Reports whether the current state is test-controlled refreshes 1.1386 + * (see advanceTimeAndRefresh and restoreNormalRefresh above). 1.1387 + */ 1.1388 + readonly attribute bool isTestControllingRefreshes; 1.1389 + 1.1390 + /** 1.1391 + * Set async scroll offset on an element. The next composite will render 1.1392 + * with that offset if async scrolling is enabled, and then the offset 1.1393 + * will be removed. Only call this while test-controlled refreshes is enabled. 1.1394 + */ 1.1395 + void setAsyncScrollOffset(in nsIDOMNode aNode, in int32_t aX, in int32_t aY); 1.1396 + 1.1397 + /** 1.1398 + * Method for testing nsStyleAnimation::ComputeDistance. 1.1399 + * 1.1400 + * Returns the distance between the two values as reported by 1.1401 + * nsStyleAnimation::ComputeDistance for the given element and 1.1402 + * property. 1.1403 + */ 1.1404 + double computeAnimationDistance(in nsIDOMElement element, 1.1405 + in AString property, 1.1406 + in AString value1, 1.1407 + in AString value2); 1.1408 + 1.1409 + /** 1.1410 + * Wrap an nsIFile in an nsIDOMFile 1.1411 + */ 1.1412 + nsIDOMFile wrapDOMFile(in nsIFile aFile); 1.1413 + 1.1414 + /** 1.1415 + * Get the type of the currently focused html input, if any. 1.1416 + */ 1.1417 + readonly attribute string focusedInputType; 1.1418 + 1.1419 + /** 1.1420 + * Given a view ID from the compositor process, retrieve the element 1.1421 + * associated with a view. For scrollpanes for documents, the root 1.1422 + * element of the document is returned. 1.1423 + */ 1.1424 + nsIDOMElement findElementWithViewId(in nsViewID aId); 1.1425 + 1.1426 + /** 1.1427 + * Find the view ID for a given element. This is the reverse of 1.1428 + * findElementWithViewId(). 1.1429 + */ 1.1430 + nsViewID getViewId(in nsIDOMElement aElement); 1.1431 + 1.1432 + /** 1.1433 + * Checks the layer tree for this window and returns true 1.1434 + * if all layers have transforms that are translations by integers, 1.1435 + * no leaf layers overlap, and the union of the leaf layers is exactly 1.1436 + * the bounds of the window. Always returns true in non-DEBUG builds. 1.1437 + */ 1.1438 + boolean leafLayersPartitionWindow(); 1.1439 + 1.1440 + /** 1.1441 + * true if the (current inner) window may have event listeners for touch events. 1.1442 + */ 1.1443 + readonly attribute boolean mayHaveTouchEventListeners; 1.1444 + 1.1445 + /** 1.1446 + * Check if any ThebesLayer painting has been done for this element, 1.1447 + * clears the painted flags if they have. 1.1448 + */ 1.1449 + boolean checkAndClearPaintedState(in nsIDOMElement aElement); 1.1450 + 1.1451 + /** 1.1452 + * Internal file constructor intended for testing of File objects. 1.1453 + * Example of constructor usage: 1.1454 + * getFile("myfile.txt", [b1, "foo"], { type: "text/plain" }) 1.1455 + */ 1.1456 + [optional_argc, implicit_jscontext] 1.1457 + nsIDOMFile getFile(in DOMString aName, [optional] in jsval aBlobParts, 1.1458 + [optional] in jsval aParameters); 1.1459 + 1.1460 + /** 1.1461 + * Internal blob constructor intended for testing of Blob objects. 1.1462 + * Example of constructor usage: 1.1463 + * getBlob([b1, "foo"], { type: "text/plain" }) 1.1464 + */ 1.1465 + [optional_argc, implicit_jscontext] 1.1466 + nsIDOMBlob getBlob([optional] in jsval aBlobParts, 1.1467 + [optional] in jsval aParameters); 1.1468 + 1.1469 + /** 1.1470 + * Get internal id of the stored blob, file or file handle. 1.1471 + */ 1.1472 + [implicit_jscontext] long long getFileId(in jsval aFile); 1.1473 + 1.1474 + /** 1.1475 + * Get file ref count info for given database and file id. 1.1476 + * 1.1477 + */ 1.1478 + [implicit_jscontext] 1.1479 + boolean getFileReferences(in AString aDatabaseName, in long long aId, 1.1480 + [optional] in jsval aOptions, 1.1481 + [optional] out long aRefCnt, 1.1482 + [optional] out long aDBRefCnt, 1.1483 + [optional] out long aSliceRefCnt); 1.1484 + 1.1485 + /** 1.1486 + * Return whether incremental GC has been disabled due to a binary add-on. 1.1487 + */ 1.1488 + [implicit_jscontext] 1.1489 + boolean isIncrementalGCEnabled(); 1.1490 + 1.1491 + /** 1.1492 + * Begin opcode-level profiling of all JavaScript execution in the window's 1.1493 + * runtime. 1.1494 + */ 1.1495 + [implicit_jscontext] 1.1496 + void startPCCountProfiling(); 1.1497 + 1.1498 + /** 1.1499 + * Stop opcode-level profiling of JavaScript execution in the runtime, and 1.1500 + * collect all counts for use by getPCCount methods. 1.1501 + */ 1.1502 + [implicit_jscontext] 1.1503 + void stopPCCountProfiling(); 1.1504 + 1.1505 + /** 1.1506 + * Purge collected PC counters. 1.1507 + */ 1.1508 + [implicit_jscontext] 1.1509 + void purgePCCounts(); 1.1510 + 1.1511 + /** 1.1512 + * Get the number of scripts with opcode-level profiling information. 1.1513 + */ 1.1514 + [implicit_jscontext] 1.1515 + long getPCCountScriptCount(); 1.1516 + 1.1517 + /** 1.1518 + * Get a JSON string for a short summary of a script and the PC counts 1.1519 + * accumulated for it. 1.1520 + */ 1.1521 + [implicit_jscontext] 1.1522 + AString getPCCountScriptSummary(in long script); 1.1523 + 1.1524 + /** 1.1525 + * Get a JSON string with full information about a profiled script, 1.1526 + * including the decompilation of the script and placement of decompiled 1.1527 + * operations within it, and PC counts for each operation. 1.1528 + */ 1.1529 + [implicit_jscontext] 1.1530 + AString getPCCountScriptContents(in long script); 1.1531 + 1.1532 + /** 1.1533 + * Returns true if painting is suppressed for this window and false 1.1534 + * otherwise. 1.1535 + */ 1.1536 + readonly attribute boolean paintingSuppressed; 1.1537 + 1.1538 + /** 1.1539 + * Returns an array of plugins on the page for opt-in activation. 1.1540 + * 1.1541 + * Cannot be accessed from unprivileged context (not content-accessible). 1.1542 + * Will throw a DOM security error if called without chrome privileges. 1.1543 + * 1.1544 + */ 1.1545 + [implicit_jscontext] 1.1546 + readonly attribute jsval plugins; 1.1547 + 1.1548 + /** 1.1549 + * Set the scrollport size for the purposes of clamping scroll positions for 1.1550 + * the root scroll frame of this document to be (aWidth,aHeight) in CSS pixels. 1.1551 + * 1.1552 + * The caller of this method must have chrome privileges. 1.1553 + */ 1.1554 + void setScrollPositionClampingScrollPortSize(in float aWidth, in float aHeight); 1.1555 + 1.1556 + /** 1.1557 + * Set margins for the layout of fixed position elements in the content 1.1558 + * document. These are used on mobile, where the viewable area can be 1.1559 + * temporarily obscured by the browser chrome. In this situation, we're ok 1.1560 + * with scrollable page content being obscured, but fixed position content 1.1561 + * cannot be revealed without removing the obscuring chrome, so we use these 1.1562 + * margins so that it can remain visible. 1.1563 + * 1.1564 + * The caller of this method must have chrome privileges. 1.1565 + */ 1.1566 + void setContentDocumentFixedPositionMargins(in float aTop, in float aRight, 1.1567 + in float aBottom, in float aLeft); 1.1568 + 1.1569 + /** 1.1570 + * These are used to control whether dialogs (alert, prompt, confirm) are 1.1571 + * allowed. 1.1572 + */ 1.1573 + void disableDialogs(); 1.1574 + void enableDialogs(); 1.1575 + bool areDialogsEnabled(); 1.1576 + 1.1577 + const unsigned long AGENT_SHEET = 0; 1.1578 + const unsigned long USER_SHEET = 1; 1.1579 + const unsigned long AUTHOR_SHEET = 2; 1.1580 + /** 1.1581 + * Synchronously loads a style sheet from |sheetURI| and adds it to the list 1.1582 + * of additional style sheets of the document. 1.1583 + * 1.1584 + * These additional style sheets are very much like user/agent sheets loaded 1.1585 + * with loadAndRegisterSheet. The only difference is that they are applied only 1.1586 + * on the document owned by this window. 1.1587 + * 1.1588 + * Sheets added via this API take effect immediately on the document. 1.1589 + */ 1.1590 + void loadSheet(in nsIURI sheetURI, 1.1591 + in unsigned long type); 1.1592 + 1.1593 + /** 1.1594 + * Remove the document style sheet at |sheetURI| from the list of additional 1.1595 + * style sheets of the document. The removal takes effect immediately. 1.1596 + */ 1.1597 + void removeSheet(in nsIURI sheetURI, 1.1598 + in unsigned long type); 1.1599 + 1.1600 + /** 1.1601 + * Returns true if a user input is being handled. 1.1602 + * 1.1603 + * This calls EventStateManager::IsHandlingUserInput(). 1.1604 + */ 1.1605 + readonly attribute boolean isHandlingUserInput; 1.1606 + 1.1607 + /** 1.1608 + * After calling the method, the window for which this DOMWindowUtils 1.1609 + * was created can be closed using scripts. 1.1610 + */ 1.1611 + void allowScriptsToClose(); 1.1612 + 1.1613 + /** 1.1614 + * Is the parent window's main widget visible? If it isn't, we probably 1.1615 + * don't want to display any dialogs etc it may request. This corresponds 1.1616 + * to the visibility check in nsWindowWatcher::OpenWindowInternal(). 1.1617 + * 1.1618 + * Will throw a DOM security error if called without chrome privileges or 1.1619 + * NS_ERROR_NOT_AVAILABLE in the unlikely event that the parent window's 1.1620 + * main widget can't be reached. 1.1621 + */ 1.1622 + readonly attribute boolean isParentWindowMainWidgetVisible; 1.1623 + 1.1624 + /** 1.1625 + * In certain cases the event handling of nodes, form controls in practice, 1.1626 + * may be disabled. Such cases are for example the existence of disabled 1.1627 + * attribute or -moz-user-input: none/disabled. 1.1628 + */ 1.1629 + boolean isNodeDisabledForEvents(in nsIDOMNode aNode); 1.1630 + 1.1631 + /** 1.1632 + * Setting paintFlashing to true will flash newly painted area. 1.1633 + */ 1.1634 + attribute boolean paintFlashing; 1.1635 + 1.1636 + /** 1.1637 + * Allows running of a "synchronous section", in the form of an nsIRunnable 1.1638 + * once the event loop has reached a "stable state". We've reached a stable 1.1639 + * state when the currently executing task/event has finished, see: 1.1640 + * http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#synchronous-section 1.1641 + * In practice this runs aRunnable once the currently executing event 1.1642 + * finishes. If called multiple times per task/event, all the runnables will 1.1643 + * be executed, in the order in which runInStableState() was called. 1.1644 + * 1.1645 + * XXX - This can wreak havoc if you're not using this for very simple 1.1646 + * purposes, eg testing or setting a flag. 1.1647 + */ 1.1648 + void runInStableState(in nsIRunnable runnable); 1.1649 + 1.1650 + /** 1.1651 + * Run the given runnable before the next iteration of the event loop (this 1.1652 + * includes native events too). If a nested loop is spawned within the current 1.1653 + * event then the runnable will not be run until that loop has terminated. 1.1654 + * 1.1655 + * XXX - This can wreak havoc if you're not using this for very simple 1.1656 + * purposes, eg testing or setting a flag. 1.1657 + */ 1.1658 + void runBeforeNextEvent(in nsIRunnable runnable); 1.1659 + 1.1660 + /* 1.1661 + * Returns the value of a given property animated on the compositor thread. 1.1662 + * If the property is NOT currently being animated on the compositor thread, 1.1663 + * returns an empty string. 1.1664 + */ 1.1665 + AString getOMTAStyle(in nsIDOMElement aElement, in AString aProperty); 1.1666 + 1.1667 + /* 1.1668 + * Returns the value of a given property. If the property is animated off 1.1669 + * the main thread, this function will fetch the correct value from the 1.1670 + * compositor. 1.1671 + */ 1.1672 + AString getOMTAOrComputedStyle(in nsIDOMElement aElement, 1.1673 + in AString aProperty); 1.1674 + 1.1675 + /** 1.1676 + * With this it's possible to mute all the MediaElements in this window. 1.1677 + * We have audioMuted and audioVolume to preserve the volume across 1.1678 + * mute/umute. 1.1679 + */ 1.1680 + attribute boolean audioMuted; 1.1681 + 1.1682 + /** 1.1683 + * range: greater or equal to 0. The real volume level is affected by the 1.1684 + * volume of all ancestor windows. 1.1685 + */ 1.1686 + attribute float audioVolume; 1.1687 +}; 1.1688 + 1.1689 +[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)] 1.1690 +interface nsITranslationNodeList : nsISupports { 1.1691 + readonly attribute unsigned long length; 1.1692 + nsIDOMNode item(in unsigned long index); 1.1693 + 1.1694 + // A translation root is a block element, or an inline element 1.1695 + // which its parent is not a translation node. 1.1696 + boolean isTranslationRootAtIndex(in unsigned long index); 1.1697 +};