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