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