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