[Web Animations] Add animations to the timeline
[WebKit-https.git] / Source / WebCore / testing / Internals.idl
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 enum PageOverlayType {
28     "view",
29     "document"
30 };
31
32 // These map to ResourceRequestCachePolicy.
33 enum CachePolicy {
34     "UseProtocolCachePolicy",
35     "ReloadIgnoringCacheData",
36     "ReturnCacheDataElseLoad",
37     "ReturnCacheDataDontLoad"
38 };
39
40 // FIXME: Strings in an enum should not have the name of the enum as a prefix.
41 enum ResourceLoadPriority {
42     "ResourceLoadPriorityVeryLow",
43     "ResourceLoadPriorityLow",
44     "ResourceLoadPriorityMedium",
45     "ResourceLoadPriorityHigh",
46     "ResourceLoadPriorityVeryHigh"
47 };
48
49 [Conditional=MEDIA_SESSION] enum MediaSessionInterruptingCategory {
50     "content",
51     "transient",
52     "transient-solo"
53 };
54
55 [Conditional=MEDIA_SESSION] enum MediaControlEvent {
56     "play-pause",
57     "next-track",
58     "previous-track"
59 };
60
61 // FIXME: Strings in an enum should not have the name of the enum as a prefix.
62 enum AutoFillButtonType {
63     "AutoFillButtonTypeNone",
64     "AutoFillButtonTypeContacts",
65     "AutoFillButtonTypeCredentials"
66 };
67
68 enum UserInterfaceLayoutDirection {
69     "LTR",
70     "RTL"
71 };
72
73 enum BaseWritingDirection {
74     "Natural",
75     "Ltr",
76     "Rtl"
77 };
78
79 enum EventThrottlingBehavior {
80     "responsive",
81     "unresponsive"
82 };
83
84 [
85     ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
86     NoInterfaceObject,
87 ] interface Internals {
88     DOMString address(Node node);
89     boolean nodeNeedsStyleRecalc(Node node);
90     DOMString styleChangeType(Node node);
91     DOMString description(any value);
92
93     // Animated image pausing testing.
94     boolean hasPausedImageAnimations(Element element);
95
96     [MayThrowException] DOMString elementRenderTreeAsText(Element element);
97     boolean isPreloaded(DOMString url);
98     boolean isLoadingFromMemoryCache(DOMString url);
99     DOMString fetchResponseSource(FetchResponse response);
100     DOMString xhrResponseSource(XMLHttpRequest xhr);
101     boolean isSharingStyleSheetContents(HTMLLinkElement a, HTMLLinkElement b);
102     boolean isStyleSheetLoadingSubresources(HTMLLinkElement link);
103     void clearMemoryCache();
104     void pruneMemoryCacheToSize(long size);
105     void destroyDecodedDataForAllImages();
106     long memoryCacheSize();
107     void setOverrideCachePolicy(CachePolicy policy);
108     void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
109     void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
110
111     void clearPageCache();
112     unsigned long pageCacheSize();
113
114     CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
115
116     Node ensureUserAgentShadowRoot(Element host);
117     Node shadowRoot(Element host);
118
119     // CSS Deferred Parsing Testing.
120     long deferredStyleRulesCount(StyleSheet sheet);
121     long deferredGroupRulesCount(StyleSheet sheet);
122     long deferredKeyframesRulesCount(StyleSheet sheet);
123
124     [MayThrowException] DOMString shadowRootType(Node root);
125     DOMString shadowPseudoId(Element element);
126     void setShadowPseudoId(Element element, DOMString id);
127     Node treeScopeRootNode(Node node);
128     Node parentTreeScope(Node node);
129
130     // Spatial Navigation testing
131     [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
132
133     // CSS Animation testing.
134     unsigned long numberOfActiveAnimations();
135     [MayThrowException] void suspendAnimations();
136     [MayThrowException] void resumeAnimations();
137     [MayThrowException] boolean animationsAreSuspended();
138     [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
139     [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
140     readonly attribute double animationsInterval;
141
142     // CSS Transition testing.
143     [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
144     [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
145
146     DOMString visiblePlaceholder(Element element);
147     void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
148     [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
149     [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
150
151     [MayThrowException] DOMRect absoluteCaretBounds();
152
153     DOMRect boundingBox(Element element);
154
155     [MayThrowException] DOMRectList inspectorHighlightRects();
156     [MayThrowException] DOMString inspectorHighlightObject();
157
158     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
159     [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
160     [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
161     [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
162     void addTextMatchMarker(Range range, boolean isActive);
163     [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
164
165     void invalidateFontCache();
166     void setFontSmoothingEnabled(boolean enabled);
167
168     [MayThrowException] void setScrollViewPosition(long x, long y);
169
170     [MayThrowException] DOMRect layoutViewportRect();
171     [MayThrowException] DOMRect visualViewportRect();
172
173     [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
174
175     [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
176     [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
177
178     [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
179
180     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
181     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
182     void setEditingValue(HTMLInputElement inputElement, DOMString value);
183     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
184     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
185
186     [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
187     [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
188     [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
189
190     [MayThrowException] DOMString autofillFieldName(Element formControlElement);
191
192     [MayThrowException] void paintControlTints();
193
194     [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
195
196     Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
197     unsigned long locationFromRange(Element scope, Range range);
198     unsigned long lengthFromRange(Element scope, Range range);
199     DOMString rangeAsText(Range range);
200     Range subrange(Range range, long rangeLocation, long rangeLength);
201     [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
202     Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
203
204     [MayThrowException] void setDelegatesScrolling(boolean enabled);
205
206     [MayThrowException] long lastSpellCheckRequestSequence();
207     [MayThrowException] long lastSpellCheckProcessedSequence();
208
209     sequence<DOMString> userPreferredLanguages();
210     void setUserPreferredLanguages(sequence<DOMString> languages);
211
212     sequence<DOMString> userPreferredAudioCharacteristics();
213     void setUserPreferredAudioCharacteristic(DOMString characteristic);
214
215     [MayThrowException] unsigned long wheelEventHandlerCount();
216     [MayThrowException] unsigned long touchEventHandlerCount();
217
218     [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
219     [MayThrowException] DOMRectList passiveTouchEventListenerRects();
220
221     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
222         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
223         boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
224
225     // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
226     DOMString parserMetaData(optional any func);
227
228     void updateEditorUINowIfScheduled();
229
230     boolean hasSpellingMarker(long from, long length);
231     boolean hasGrammarMarker(long from, long length);
232     boolean hasAutocorrectedMarker(long from, long length);
233     void setContinuousSpellCheckingEnabled(boolean enabled);
234     void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
235     void setAutomaticLinkDetectionEnabled(boolean enabled);
236     void setAutomaticDashSubstitutionEnabled(boolean enabled);
237     void setAutomaticTextReplacementEnabled(boolean enabled);
238     void setAutomaticSpellingCorrectionEnabled(boolean enabled);
239
240     void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
241
242     boolean isOverwriteModeEnabled();
243     void toggleOverwriteModeEnabled();
244
245     unsigned long numberOfScrollableAreas();
246
247     [MayThrowException] boolean isPageBoxVisible(long pageNumber);
248
249     unsigned long imageFrameIndex(HTMLImageElement element);
250     void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
251     void resetImageAnimation(HTMLImageElement element);
252     boolean isImageAnimating(HTMLImageElement element);
253     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
254     unsigned long imageDecodeCount(HTMLImageElement element);
255     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
256
257     void setGridMaxTracksLimit(unsigned long maxTracksLimit);
258
259     readonly attribute InternalSettings settings;
260     readonly attribute unsigned long workerThreadCount;
261
262     [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
263     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
264
265     // Flags for layerTreeAsText.
266     const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
267     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
268     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
269     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
270     const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
271     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
272     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
273     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
274
275     [MayThrowException] unsigned long long layerIDForElement(Element element);
276
277     [MayThrowException] DOMString scrollingStateTreeAsText();
278     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
279     [MayThrowException] DOMRectList nonFastScrollableRects();
280
281     [MayThrowException] DOMString repaintRectsAsText();
282
283     // These throw if the element does not have a compositing layer.
284     [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
285     [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
286
287     // Flags for displayListForElement.
288     const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
289     // Returns the recorded display list.
290     [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
291     // Returns the display list that was actually painted.
292     [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
293
294     [MayThrowException] void garbageCollectDocumentResources();
295
296     [MayThrowException] void insertAuthorCSS(DOMString css);
297     [MayThrowException] void insertUserCSS(DOMString css);
298
299     readonly attribute boolean isUnderMemoryPressure;
300     void beginSimulatedMemoryPressure();
301     void endSimulatedMemoryPressure();
302
303     unsigned long numberOfLiveNodes();
304     unsigned long numberOfLiveDocuments();
305     unsigned long referencingNodeCount(Document document);
306     DOMWindow? openDummyInspectorFrontend(DOMString url);
307     void closeDummyInspectorFrontend();
308     [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
309
310     DOMString counterValue(Element element);
311     long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
312     sequence<DOMString> shortcutIconURLs();
313     long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
314     [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
315     [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
316
317     [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
318     [MayThrowException] float pageScaleFactor();
319
320     [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
321     [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
322
323     [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
324     [MayThrowException] void setFixedLayoutSize(long width, long height);
325     void setPrinting(long width, long height);
326
327     [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
328
329     void setHeaderHeight(unrestricted float height);
330     void setFooterHeight(unrestricted float height);
331
332     void setTopContentInset(unrestricted float contentInset);
333
334     [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
335     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
336     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
337     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
338
339     void setApplicationCacheOriginQuota(unsigned long long quota);
340
341     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
342     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
343
344     void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
345
346     MallocStatistics mallocStatistics();
347     TypeConversions typeConversions();
348     MemoryInfo memoryInfo();
349
350     sequence<DOMString> getReferencedFilePaths();
351
352     // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
353     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
354     [MayThrowException] void startTrackingRepaints();
355     [MayThrowException] void stopTrackingRepaints();
356
357     [MayThrowException] void startTrackingLayerFlushes();
358     [MayThrowException] unsigned long layerFlushCount();
359
360     // Query if a timer is currently throttled, to debug timer throttling.
361     [MayThrowException] boolean isTimerThrottled(long timerHandle);
362
363     boolean isRequestAnimationFrameThrottled();
364     boolean areTimersThrottled();
365
366     [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
367     readonly attribute double requestAnimationFrameInterval;
368     readonly attribute boolean scriptedAnimationsAreSuspended;
369
370     // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
371     attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
372
373     [MayThrowException] void startTrackingStyleRecalcs();
374     [MayThrowException] unsigned long styleRecalcCount();
375     readonly attribute unsigned long lastStyleUpdateSize;
376
377     [MayThrowException] void startTrackingCompositingUpdates();
378     [MayThrowException] unsigned long compositingUpdateCount();
379
380     // |node| should be Document, HTMLIFrameElement, or unspecified.
381     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
382     // specified without security checks. Unspecified or null means this document.
383     [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
384
385     readonly attribute unsigned long layoutCount;
386
387     // Returns a string with information about the mouse cursor used at the specified client location.
388     [MayThrowException] DOMString getCurrentCursorInfo();
389
390     DOMString markerTextForListItem(Element element);
391
392     DOMString toolTipFromElement(Element element);
393
394     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
395     ArrayBuffer serializeObject(SerializedScriptValue object);
396
397     boolean isFromCurrentWorld(any obj);
398
399     void setUsesOverlayScrollbars(boolean enabled);
400     void setUsesMockScrollAnimator(boolean enabled);
401
402     void forceReload(boolean endToEnd);
403     void reloadExpiredOnly();
404
405     void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
406
407     [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
408     [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
409     [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
410     [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
411
412     [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
413     [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
414
415     [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
416
417     DOMString getImageSourceURL(Element element);
418
419     [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
420     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
421     [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
422     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
423
424     [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
425      endTimes);
426     [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
427
428     boolean isSelectPopupVisible(HTMLSelectElement element);
429
430     [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
431     boolean isPluginSnapshotted(Element element);
432
433     [MayThrowException] DOMRect selectionBounds();
434
435     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
436     [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
437     [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
438     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
439
440     [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
441     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
442     [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
443     [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
444     [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
445     [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
446     [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
447     [Conditional=VIDEO] void applicationWillBecomeInactive();
448     [Conditional=VIDEO] void applicationDidBecomeActive();
449     [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
450     [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
451     [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
452     [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
453     [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
454     [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
455     [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
456     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
457     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
458     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
459
460     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
461     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
462     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
463     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
464     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
465
466     [Conditional=VIDEO] void simulateSystemSleep();
467     [Conditional=VIDEO] void simulateSystemWake();
468     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
469
470     [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
471     [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
472
473     void setPageMuted(DOMString mutedState);
474     DOMString pageMediaState();
475
476     void setPageDefersLoading(boolean defersLoading);
477
478     File? createFile(DOMString url);
479     void queueMicroTask(long testNumber);
480     boolean testPreloaderSettingViewport();
481
482     [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
483
484     [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
485     [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
486
487     [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
488
489     [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
490
491     DOMString userVisibleString(DOMURL url);
492
493     void setShowAllPlugins(boolean showAll);
494
495     [Conditional=STREAMS_API, CallWith=ScriptState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
496     [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream);
497
498     DOMString resourceLoadStatisticsForOrigin(DOMString domain);
499     void setResourceLoadStatisticsEnabled(boolean enable);
500     [EnabledBySetting=StorageAccessAPI] void setUserGrantsStorageAccess(boolean value);
501
502     [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
503
504     DOMString composedTreeAsText(Node parent);
505
506     boolean isProcessingUserGesture();
507     double lastHandledUserGestureTimestamp();
508
509     GCObservation? observeGC(any observed);
510
511     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
512     void setBaseWritingDirection(BaseWritingDirection direction);
513
514     boolean userPrefersReducedMotion();
515     
516     void reportBacktrace();
517
518     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
519     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
520
521     sequence<DOMString> accessKeyModifiers();
522
523     void setQuickLookPassword(DOMString password);
524
525     [CallWith=Document] void setAsRunningUserScripts();
526
527     void disableTileSizeUpdateDelay();
528     void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
529
530     [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
531     [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
532
533     void setPageVisibility(boolean isVisible);
534
535     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
536     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
537
538     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
539     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
540     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
541     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
542     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
543     [Conditional=MEDIA_STREAM, MayThrowException] void setMediaDeviceState(DOMString deviceID, DOMString property, boolean value);
544     [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
545     [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
546     [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
547     [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
548
549     Promise<void> clearCacheStorageMemoryRepresentation();
550     Promise<DOMString> cacheStorageEngineRepresentation();
551     void setResponseSizeWithPadding(FetchResponse response, unsigned long long size);
552     unsigned long long responseSizeWithPadding(FetchResponse response);
553
554     void setConsoleMessageListener(StringCallback callback);
555
556     DOMString audioSessionCategory();
557
558     [Conditional=SERVICE_WORKER] Promise<Response> waitForFetchEventToFinish(FetchEvent event);
559     [Conditional=SERVICE_WORKER] Promise<void> waitForExtendableEventToFinish(ExtendableEvent event);
560     [Conditional=SERVICE_WORKER] ExtendableEvent createTrustedExtendableEvent();
561
562     boolean hasServiceWorkerRegisteredForOrigin(DOMString origin);
563
564     [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline);
565 };