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