[Experiment] Implement code to detect high frequency painting
[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     // Must be called on an element whose enclosingLayer() is self-painting.
97     boolean isPaintingFrequently(Element element);
98     void incrementFrequentPaintCounter(Element element);
99
100     [MayThrowException] DOMString elementRenderTreeAsText(Element element);
101     boolean isPreloaded(DOMString url);
102     boolean isLoadingFromMemoryCache(DOMString url);
103     DOMString fetchResponseSource(FetchResponse response);
104     DOMString xhrResponseSource(XMLHttpRequest xhr);
105     boolean isSharingStyleSheetContents(HTMLLinkElement a, HTMLLinkElement b);
106     boolean isStyleSheetLoadingSubresources(HTMLLinkElement link);
107     void clearMemoryCache();
108     void pruneMemoryCacheToSize(long size);
109     void destroyDecodedDataForAllImages();
110     long memoryCacheSize();
111     void setOverrideCachePolicy(CachePolicy policy);
112     void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
113     void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
114
115     void clearPageCache();
116     unsigned long pageCacheSize();
117
118     CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
119
120     Node ensureUserAgentShadowRoot(Element host);
121     Node shadowRoot(Element host);
122
123     // CSS Deferred Parsing Testing.
124     long deferredStyleRulesCount(StyleSheet sheet);
125     long deferredGroupRulesCount(StyleSheet sheet);
126     long deferredKeyframesRulesCount(StyleSheet sheet);
127
128     [MayThrowException] DOMString shadowRootType(Node root);
129     DOMString shadowPseudoId(Element element);
130     void setShadowPseudoId(Element element, DOMString id);
131     Node treeScopeRootNode(Node node);
132     Node parentTreeScope(Node node);
133
134     // Spatial Navigation testing
135     [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
136
137     // CSS Animation testing.
138     unsigned long numberOfActiveAnimations();
139     [MayThrowException] void suspendAnimations();
140     [MayThrowException] void resumeAnimations();
141     [MayThrowException] boolean animationsAreSuspended();
142     [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
143     [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
144     readonly attribute double animationsInterval;
145
146     // CSS Transition testing.
147     [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
148     [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
149
150     DOMString visiblePlaceholder(Element element);
151     void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
152     [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
153     [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
154
155     [MayThrowException] DOMRect absoluteCaretBounds();
156
157     DOMRect boundingBox(Element element);
158
159     [MayThrowException] DOMRectList inspectorHighlightRects();
160     [MayThrowException] DOMString inspectorHighlightObject();
161
162     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
163     [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
164     [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
165     [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
166     void addTextMatchMarker(Range range, boolean isActive);
167     [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
168
169     void invalidateFontCache();
170     void setFontSmoothingEnabled(boolean enabled);
171
172     [MayThrowException] void setScrollViewPosition(long x, long y);
173
174     // Like Element.scrollTo(), but without constaints, for testing rubber-banding.
175     [MayThrowException] void unconstrainedScrollTo(Element element, unrestricted double x, unrestricted double y);
176
177     [MayThrowException] DOMRect layoutViewportRect();
178     [MayThrowException] DOMRect visualViewportRect();
179
180     [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
181
182     [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
183     [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
184
185     [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
186
187     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
188     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
189     void setEditingValue(HTMLInputElement inputElement, DOMString value);
190     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
191     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
192
193     [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
194     [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
195     [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
196
197     [MayThrowException] DOMString autofillFieldName(Element formControlElement);
198
199     [MayThrowException] void paintControlTints();
200
201     [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
202
203     Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
204     unsigned long locationFromRange(Element scope, Range range);
205     unsigned long lengthFromRange(Element scope, Range range);
206     DOMString rangeAsText(Range range);
207     Range subrange(Range range, long rangeLocation, long rangeLength);
208     [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
209     Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
210
211     [MayThrowException] void setDelegatesScrolling(boolean enabled);
212
213     [MayThrowException] long lastSpellCheckRequestSequence();
214     [MayThrowException] long lastSpellCheckProcessedSequence();
215
216     sequence<DOMString> userPreferredLanguages();
217     void setUserPreferredLanguages(sequence<DOMString> languages);
218
219     sequence<DOMString> userPreferredAudioCharacteristics();
220     void setUserPreferredAudioCharacteristic(DOMString characteristic);
221
222     [MayThrowException] unsigned long wheelEventHandlerCount();
223     [MayThrowException] unsigned long touchEventHandlerCount();
224
225     [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
226     [MayThrowException] DOMRectList passiveTouchEventListenerRects();
227
228     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
229         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
230         boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
231
232     // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
233     DOMString parserMetaData(optional any func);
234
235     void updateEditorUINowIfScheduled();
236
237     boolean hasSpellingMarker(long from, long length);
238     boolean hasGrammarMarker(long from, long length);
239     boolean hasAutocorrectedMarker(long from, long length);
240     void setContinuousSpellCheckingEnabled(boolean enabled);
241     void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
242     void setAutomaticLinkDetectionEnabled(boolean enabled);
243     void setAutomaticDashSubstitutionEnabled(boolean enabled);
244     void setAutomaticTextReplacementEnabled(boolean enabled);
245     void setAutomaticSpellingCorrectionEnabled(boolean enabled);
246
247     void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
248
249     boolean isOverwriteModeEnabled();
250     void toggleOverwriteModeEnabled();
251
252     unsigned long numberOfScrollableAreas();
253
254     [MayThrowException] boolean isPageBoxVisible(long pageNumber);
255
256     unsigned long imageFrameIndex(HTMLImageElement element);
257     void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
258     void resetImageAnimation(HTMLImageElement element);
259     boolean isImageAnimating(HTMLImageElement element);
260     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
261     unsigned long imageDecodeCount(HTMLImageElement element);
262     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
263
264     void setGridMaxTracksLimit(unsigned long maxTracksLimit);
265
266     readonly attribute InternalSettings settings;
267     readonly attribute unsigned long workerThreadCount;
268
269     [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
270     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
271
272     // Flags for layerTreeAsText.
273     const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
274     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
275     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
276     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
277     const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
278     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
279     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
280     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
281
282     [MayThrowException] unsigned long long layerIDForElement(Element element);
283
284     [MayThrowException] DOMString scrollingStateTreeAsText();
285     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
286     [MayThrowException] DOMRectList nonFastScrollableRects();
287
288     [MayThrowException] DOMString repaintRectsAsText();
289
290     // These throw if the element does not have a compositing layer.
291     [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
292     [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
293
294     // Flags for displayListForElement.
295     const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
296     // Returns the recorded display list.
297     [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
298     // Returns the display list that was actually painted.
299     [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
300
301     [MayThrowException] void garbageCollectDocumentResources();
302
303     [MayThrowException] void insertAuthorCSS(DOMString css);
304     [MayThrowException] void insertUserCSS(DOMString css);
305
306     readonly attribute boolean isUnderMemoryPressure;
307     void beginSimulatedMemoryPressure();
308     void endSimulatedMemoryPressure();
309
310     unsigned long numberOfLiveNodes();
311     unsigned long numberOfLiveDocuments();
312     unsigned long referencingNodeCount(Document document);
313     DOMWindow? openDummyInspectorFrontend(DOMString url);
314     void closeDummyInspectorFrontend();
315     [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
316
317     DOMString counterValue(Element element);
318     long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
319     sequence<DOMString> shortcutIconURLs();
320     long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
321     [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
322     [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
323
324     [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
325     [MayThrowException] float pageScaleFactor();
326
327     [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
328     [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
329
330     [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
331     [MayThrowException] void setFixedLayoutSize(long width, long height);
332     void setPrinting(long width, long height);
333
334     [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
335
336     void setHeaderHeight(unrestricted float height);
337     void setFooterHeight(unrestricted float height);
338
339     void setTopContentInset(unrestricted float contentInset);
340
341     [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
342     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
343     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
344     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
345
346     void setApplicationCacheOriginQuota(unsigned long long quota);
347
348     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
349     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
350
351     void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
352
353     MallocStatistics mallocStatistics();
354     TypeConversions typeConversions();
355     MemoryInfo memoryInfo();
356
357     sequence<DOMString> getReferencedFilePaths();
358
359     // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
360     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
361     [MayThrowException] void startTrackingRepaints();
362     [MayThrowException] void stopTrackingRepaints();
363
364     [MayThrowException] void startTrackingLayerFlushes();
365     [MayThrowException] unsigned long layerFlushCount();
366
367     // Query if a timer is currently throttled, to debug timer throttling.
368     [MayThrowException] boolean isTimerThrottled(long timerHandle);
369
370     boolean isRequestAnimationFrameThrottled();
371     boolean areTimersThrottled();
372
373     [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
374     readonly attribute double requestAnimationFrameInterval;
375     readonly attribute boolean scriptedAnimationsAreSuspended;
376
377     // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
378     attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
379
380     [MayThrowException] void startTrackingStyleRecalcs();
381     [MayThrowException] unsigned long styleRecalcCount();
382     readonly attribute unsigned long lastStyleUpdateSize;
383
384     [MayThrowException] void startTrackingCompositingUpdates();
385     [MayThrowException] unsigned long compositingUpdateCount();
386
387     // |node| should be Document, HTMLIFrameElement, or unspecified.
388     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
389     // specified without security checks. Unspecified or null means this document.
390     [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
391
392     readonly attribute unsigned long layoutCount;
393
394     // Returns a string with information about the mouse cursor used at the specified client location.
395     [MayThrowException] DOMString getCurrentCursorInfo();
396
397     DOMString markerTextForListItem(Element element);
398
399     DOMString toolTipFromElement(Element element);
400
401     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
402     ArrayBuffer serializeObject(SerializedScriptValue object);
403
404     boolean isFromCurrentWorld(any obj);
405
406     void setUsesOverlayScrollbars(boolean enabled);
407     void setUsesMockScrollAnimator(boolean enabled);
408
409     void forceReload(boolean endToEnd);
410     void reloadExpiredOnly();
411
412     void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
413
414     [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
415     [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
416     [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
417     [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
418
419     [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
420     [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
421
422     [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
423
424     DOMString getImageSourceURL(Element element);
425
426     [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
427     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
428     [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
429     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
430
431     [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
432      endTimes);
433     [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
434
435     boolean isSelectPopupVisible(HTMLSelectElement element);
436
437     [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
438     boolean isPluginSnapshotted(Element element);
439
440     [MayThrowException] DOMRect selectionBounds();
441
442     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
443     [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
444     [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
445     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
446
447     [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
448     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
449     [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
450     [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
451     [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
452     [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
453     [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
454     [Conditional=VIDEO] void applicationWillBecomeInactive();
455     [Conditional=VIDEO] void applicationDidBecomeActive();
456     [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
457     [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
458     [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
459     [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
460     [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
461     [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
462     [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
463     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
464     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
465     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
466
467     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
468     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
469     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
470     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
471     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
472
473     [Conditional=VIDEO] void simulateSystemSleep();
474     [Conditional=VIDEO] void simulateSystemWake();
475     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
476
477     [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
478     [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
479
480     void setPageMuted(DOMString mutedState);
481     DOMString pageMediaState();
482
483     void setPageDefersLoading(boolean defersLoading);
484
485     File? createFile(DOMString url);
486     void queueMicroTask(long testNumber);
487     boolean testPreloaderSettingViewport();
488
489     [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
490
491     [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
492     [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
493
494     [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
495
496     [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
497
498     DOMString userVisibleString(DOMURL url);
499
500     void setShowAllPlugins(boolean showAll);
501
502     [Conditional=STREAMS_API, CallWith=ScriptState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
503     [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream);
504
505     DOMString resourceLoadStatisticsForOrigin(DOMString domain);
506     void setResourceLoadStatisticsEnabled(boolean enable);
507     [EnabledBySetting=StorageAccessAPI] void setUserGrantsStorageAccess(boolean value);
508
509     [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
510
511     DOMString composedTreeAsText(Node parent);
512
513     boolean isProcessingUserGesture();
514     double lastHandledUserGestureTimestamp();
515
516     GCObservation? observeGC(any observed);
517
518     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
519     void setBaseWritingDirection(BaseWritingDirection direction);
520
521     boolean userPrefersReducedMotion();
522     
523     void reportBacktrace();
524
525     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
526     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
527
528     sequence<DOMString> accessKeyModifiers();
529
530     void setQuickLookPassword(DOMString password);
531
532     [CallWith=Document] void setAsRunningUserScripts();
533
534     void disableTileSizeUpdateDelay();
535     void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
536
537     [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
538     [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
539
540     void setPageVisibility(boolean isVisible);
541
542     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
543     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
544
545     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
546     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
547     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
548     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
549     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
550     [Conditional=MEDIA_STREAM, MayThrowException] void setMediaDeviceState(DOMString deviceID, DOMString property, boolean value);
551     [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
552     [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
553     [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
554     [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
555
556     Promise<void> clearCacheStorageMemoryRepresentation();
557     Promise<DOMString> cacheStorageEngineRepresentation();
558     void setResponseSizeWithPadding(FetchResponse response, unsigned long long size);
559     unsigned long long responseSizeWithPadding(FetchResponse response);
560
561     void setConsoleMessageListener(StringCallback callback);
562
563     DOMString audioSessionCategory();
564
565     [Conditional=SERVICE_WORKER] Promise<Response> waitForFetchEventToFinish(FetchEvent event);
566     [Conditional=SERVICE_WORKER] Promise<void> waitForExtendableEventToFinish(ExtendableEvent event);
567     [Conditional=SERVICE_WORKER, CallWith=ScriptExecutionContext] FetchEvent createBeingDispatchedFetchEvent();
568     [Conditional=SERVICE_WORKER] ExtendableEvent createTrustedExtendableEvent();
569     [Conditional=SERVICE_WORKER] Promise<boolean> hasServiceWorkerRegistration(DOMString scopeURL);
570
571     boolean hasServiceWorkerRegisteredForOrigin(DOMString origin);
572
573     [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline);
574     [EnabledAtRuntime=WebAnimations] void pauseTimeline(AnimationTimeline timeline);
575     [EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime);
576     [Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
577 };