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