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