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