6c4bfebf0c340bb4a2f5b388e9aaf614a78424af
[WebKit-https.git] / Source / WebCore / testing / Internals.idl
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013-2019 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
247     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
248     [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
249     [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
250     [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
251     void addTextMatchMarker(Range range, boolean isActive);
252     [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
253
254     void invalidateFontCache();
255     void setFontSmoothingEnabled(boolean enabled);
256
257     [MayThrowException] void setScrollViewPosition(long x, long y);
258
259     // Like Element.scrollTo(), but without constaints, for testing rubber-banding.
260     [MayThrowException] void unconstrainedScrollTo(Element element, unrestricted double x, unrestricted double y);
261
262     [MayThrowException] DOMRect layoutViewportRect();
263     [MayThrowException] DOMRect visualViewportRect();
264
265     [MayThrowException] void setViewIsTransparent(boolean trnasparent);
266
267     [MayThrowException] DOMString viewBaseBackgroundColor();
268     [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
269
270     [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
271     [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
272
273     [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
274
275     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
276     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
277     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
278     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
279     AutoFillButtonType autoFillButtonType(HTMLInputElement inputElement);
280     AutoFillButtonType lastAutoFillButtonType(HTMLInputElement inputElement);
281
282     [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
283     [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
284     [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
285
286     [MayThrowException] DOMString autofillFieldName(Element formControlElement);
287
288     [MayThrowException] void invalidateControlTints();
289
290     [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
291
292     Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
293     unsigned long locationFromRange(Element scope, Range range);
294     unsigned long lengthFromRange(Element scope, Range range);
295     DOMString rangeAsText(Range range);
296     Range subrange(Range range, long rangeLocation, long rangeLength);
297     [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
298     Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
299
300     [MayThrowException] void setDelegatesScrolling(boolean enabled);
301
302     [MayThrowException] long lastSpellCheckRequestSequence();
303     [MayThrowException] long lastSpellCheckProcessedSequence();
304
305     sequence<DOMString> userPreferredLanguages();
306     void setUserPreferredLanguages(sequence<DOMString> languages);
307
308     sequence<DOMString> userPreferredAudioCharacteristics();
309     void setUserPreferredAudioCharacteristic(DOMString characteristic);
310
311     [MayThrowException] unsigned long wheelEventHandlerCount();
312     [MayThrowException] unsigned long touchEventHandlerCount();
313
314     [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
315     [MayThrowException] DOMRectList passiveTouchEventListenerRects();
316
317     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
318         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
319         boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
320
321     // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
322     DOMString parserMetaData(optional any func);
323
324     void updateEditorUINowIfScheduled();
325
326     readonly attribute boolean sentenceRetroCorrectionEnabled;
327     boolean hasSpellingMarker(long from, long length);
328     boolean hasGrammarMarker(long from, long length);
329     boolean hasAutocorrectedMarker(long from, long length);
330     void setContinuousSpellCheckingEnabled(boolean enabled);
331     void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
332     void setAutomaticLinkDetectionEnabled(boolean enabled);
333     void setAutomaticDashSubstitutionEnabled(boolean enabled);
334     void setAutomaticTextReplacementEnabled(boolean enabled);
335     void setAutomaticSpellingCorrectionEnabled(boolean enabled);
336
337     void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
338     void changeSelectionListType();
339
340     boolean isOverwriteModeEnabled();
341     void toggleOverwriteModeEnabled();
342
343     unsigned long numberOfScrollableAreas();
344
345     [MayThrowException] boolean isPageBoxVisible(long pageNumber);
346
347     unsigned long imageFrameIndex(HTMLImageElement element);
348     void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
349     void resetImageAnimation(HTMLImageElement element);
350     boolean isImageAnimating(HTMLImageElement element);
351     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
352     unsigned long imageDecodeCount(HTMLImageElement element);
353     unsigned long pdfDocumentCachingCount(HTMLImageElement element);
354     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
355     void setForceUpdateImageDataEnabledForTesting(HTMLImageElement element, boolean enabled);
356
357     void setGridMaxTracksLimit(unsigned long maxTracksLimit);
358
359     readonly attribute InternalSettings settings;
360     readonly attribute unsigned long workerThreadCount;
361
362     [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
363     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
364
365     // Flags for layerTreeAsText.
366     const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
367     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
368     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
369     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
370     const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
371     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
372     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
373     const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 128;
374     const unsigned short LAYER_TREE_INCLUDES_EVENT_REGION = 256;
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(optional Node? node = null);
380     [MayThrowException] boolean scrollbarUsingDarkAppearance(optional Node? node = null);
381
382     [MayThrowException] DOMString scrollingStateTreeAsText();
383     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
384     [MayThrowException] DOMRectList nonFastScrollableRects();
385
386     [MayThrowException] DOMString repaintRectsAsText();
387
388     // These throw if the element does not have a compositing layer.
389     [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
390     [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
391
392     // Flags for displayListForElement.
393     const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
394     // Returns the recorded display list.
395     [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
396     // Returns the display list that was actually painted.
397     [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
398
399     [MayThrowException] void garbageCollectDocumentResources();
400
401     [MayThrowException] void insertAuthorCSS(DOMString css);
402     [MayThrowException] void insertUserCSS(DOMString css);
403
404     readonly attribute boolean isUnderMemoryPressure;
405     void beginSimulatedMemoryPressure();
406     void endSimulatedMemoryPressure();
407
408     unsigned long numberOfIDBTransactions();
409
410     unsigned long numberOfLiveNodes();
411     unsigned long numberOfLiveDocuments();
412     unsigned long referencingNodeCount(Document document);
413     [Conditional=INTERSECTION_OBSERVER] unsigned long numberOfIntersectionObservers(Document document);
414     WindowProxy? openDummyInspectorFrontend(DOMString url);
415     void closeDummyInspectorFrontend();
416     [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
417
418     DOMString counterValue(Element element);
419     long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
420     sequence<DOMString> shortcutIconURLs();
421     long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
422     [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
423     [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
424
425     [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
426     [MayThrowException] float pageScaleFactor();
427
428     [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
429     [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
430
431     [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
432     [MayThrowException] void setFixedLayoutSize(long width, long height);
433     void setPrinting(long width, long height);
434
435     [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
436
437     void setHeaderHeight(unrestricted float height);
438     void setFooterHeight(unrestricted float height);
439
440     void setTopContentInset(unrestricted float contentInset);
441
442     [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
443     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
444     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
445     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
446     [Conditional=FULLSCREEN_API] readonly attribute boolean isAnimatingFullScreen;
447
448     void setFullscreenInsets(FullscreenInsets insets);
449     void setFullscreenAutoHideDuration(double duration);
450     void setFullscreenControlsHidden(boolean hidden);
451
452     void setApplicationCacheOriginQuota(unsigned long long quota);
453
454     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
455     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
456
457     void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
458
459     MallocStatistics mallocStatistics();
460     TypeConversions typeConversions();
461     MemoryInfo memoryInfo();
462
463     sequence<DOMString> getReferencedFilePaths();
464
465     // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
466     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
467     [MayThrowException] void startTrackingRepaints();
468     [MayThrowException] void stopTrackingRepaints();
469
470     [MayThrowException] void startTrackingLayerFlushes();
471     [MayThrowException] unsigned long layerFlushCount();
472
473     // Query if a timer is currently throttled, to debug timer throttling.
474     [MayThrowException] boolean isTimerThrottled(long timerHandle);
475
476     boolean isRequestAnimationFrameThrottled();
477     boolean areTimersThrottled();
478
479     [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
480     readonly attribute double requestAnimationFrameInterval;
481     readonly attribute boolean scriptedAnimationsAreSuspended;
482
483     // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
484     attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
485
486     [MayThrowException] void startTrackingStyleRecalcs();
487     [MayThrowException] unsigned long styleRecalcCount();
488     readonly attribute unsigned long lastStyleUpdateSize;
489
490     [MayThrowException] void startTrackingCompositingUpdates();
491     [MayThrowException] unsigned long compositingUpdateCount();
492
493     attribute CompositingPolicy? compositingPolicyOverride;
494
495     // |node| should be Document, HTMLIFrameElement, or unspecified.
496     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
497     // specified without security checks. Unspecified or null means this document.
498     [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
499
500     readonly attribute unsigned long layoutCount;
501
502     // Returns a string with information about the mouse cursor used at the specified client location.
503     [MayThrowException] DOMString getCurrentCursorInfo();
504
505     DOMString markerTextForListItem(Element element);
506
507     DOMString toolTipFromElement(Element element);
508
509     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
510     ArrayBuffer serializeObject(SerializedScriptValue object);
511
512     boolean isFromCurrentWorld(any obj);
513
514     void setUsesOverlayScrollbars(boolean enabled);
515     void setUsesMockScrollAnimator(boolean enabled);
516
517     void forceReload(boolean endToEnd);
518     void reloadExpiredOnly();
519
520     void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
521
522     [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
523     [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
524     [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
525     [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
526     [Conditional=VIDEO] void beginSimulatedHDCPError(HTMLMediaElement media);
527     [Conditional=VIDEO] void endSimulatedHDCPError(HTMLMediaElement media);
528
529     [Conditional=VIDEO] boolean elementShouldBufferData(HTMLMediaElement media);
530
531     [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
532     [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
533     void enableMockMediaCapabilities();
534
535     [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
536
537     DOMString getImageSourceURL(Element element);
538
539     [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
540     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
541     [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
542     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
543
544     [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
545      endTimes);
546     [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
547
548     boolean isSelectPopupVisible(HTMLSelectElement element);
549
550     [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
551     [MayThrowException] DOMString unavailablePluginReplacementText(Element element);
552     boolean isPluginSnapshotted(Element element);
553     boolean pluginIsBelowSizeThreshold(Element element);
554
555     [MayThrowException] DOMRect selectionBounds();
556     void setSelectionWithoutValidation(Node baseNode, unsigned long baseOffset, Node? extentNode, unsigned long extentOffset);
557
558     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
559     [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
560     [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
561     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
562
563     [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
564     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
565     [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
566     [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
567     [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
568     [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
569     [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
570     [Conditional=VIDEO] void applicationWillBecomeInactive();
571     [Conditional=VIDEO] void applicationDidBecomeActive();
572     [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
573     [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
574     [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
575     [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
576     [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
577     [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
578     [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
579     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
580     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
581     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
582     [Conditional=MEDIA_STREAM] void setCustomPrivateRecorderCreator();
583
584     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
585     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
586     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
587     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
588     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
589     [Conditional=WEB_RTC] void clearPeerConnectionFactory();
590
591     [Conditional=VIDEO] void simulateSystemSleep();
592     [Conditional=VIDEO] void simulateSystemWake();
593     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
594
595     [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
596     [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
597
598     void setPageMuted(DOMString mutedState);
599     DOMString pageMediaState();
600
601     void setPageDefersLoading(boolean defersLoading);
602     [MayThrowException] boolean pageDefersLoading();
603
604     File? createFile(DOMString url);
605     void queueMicroTask(long testNumber);
606     boolean testPreloaderSettingViewport();
607
608     [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
609
610     [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
611     [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
612
613     [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
614
615     [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
616
617     DOMString userVisibleString(DOMURL url);
618
619     void setShowAllPlugins(boolean showAll);
620
621     [Conditional=STREAMS_API, CallWith=ExecState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
622     [Conditional=STREAMS_API, CallWith=ExecState] boolean isReadableStreamDisturbed(any stream);
623
624     DOMString resourceLoadStatisticsForURL(DOMURL url);
625     void setResourceLoadStatisticsEnabled(boolean enable);
626     [EnabledBySetting=StorageAccessAPI] void setUserGrantsStorageAccess(boolean value);
627
628     [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
629
630     DOMString composedTreeAsText(Node parent);
631
632     boolean isProcessingUserGesture();
633     double lastHandledUserGestureTimestamp();
634
635     void withUserGesture(VoidCallback callback);
636
637     GCObservation? observeGC(any observed);
638
639     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
640     void setBaseWritingDirection(BaseWritingDirection direction);
641
642     boolean userPrefersReducedMotion();
643     
644     void reportBacktrace();
645
646     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
647     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
648
649     sequence<DOMString> accessKeyModifiers();
650
651     void setQuickLookPassword(DOMString password);
652
653     [CallWith=Document] void setAsRunningUserScripts();
654     [CallWith=Document, Conditional=APPLE_PAY] void setHasStartedApplePaySession();
655
656     void disableTileSizeUpdateDelay();
657     void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
658
659     [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
660     [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
661     [Conditional=WEBGL] boolean hasLowAndHighPowerGPUs();
662
663     void setPageVisibility(boolean isVisible);
664     void setPageIsFocusedAndActive(boolean isFocused);
665
666     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
667     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
668
669     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
670     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
671     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
672     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
673     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
674     [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
675     [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
676     [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
677     [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
678     [Conditional=MEDIA_STREAM] void setMediaStreamTrackIdentifier(MediaStreamTrack track, DOMString identifier);
679     [Conditional=MEDIA_STREAM] void setMediaStreamSourceInterrupted(MediaStreamTrack track, boolean interrupted);
680
681     unsigned long long documentIdentifier(Document document);
682     boolean isDocumentAlive(unsigned long long documentIdentifier);
683
684     boolean isAnyWorkletGlobalScopeAlive();
685
686     DOMString serviceWorkerClientIdentifier(Document document);
687
688     Promise<void> clearCacheStorageMemoryRepresentation();
689     Promise<DOMString> cacheStorageEngineRepresentation();
690     void setResponseSizeWithPadding(FetchResponse response, unsigned long long size);
691     unsigned long long responseSizeWithPadding(FetchResponse response);
692
693     void updateQuotaBasedOnSpaceUsage();
694
695     void setConsoleMessageListener(StringCallback callback);
696
697     DOMString audioSessionCategory();
698     double preferredAudioBufferSize();
699     boolean audioSessionActive();
700
701     [Conditional=SERVICE_WORKER] Promise<boolean> hasServiceWorkerRegistration(DOMString scopeURL);
702     [Conditional=SERVICE_WORKER] void terminateServiceWorker(ServiceWorker worker);
703     [Conditional=SERVICE_WORKER] boolean hasServiceWorkerConnection();
704
705     [CallWith=Document, Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
706
707     boolean isSystemPreviewLink(Element element);
708     boolean isSystemPreviewImage(Element element);
709
710     boolean usingAppleInternalSDK();
711
712     void postTask(VoidCallback callback);
713     void markContextAsInsecure();
714
715     [Conditional=VIDEO, MayThrowException] readonly attribute NowPlayingState nowPlayingState;
716
717     [Conditional=VIDEO] HTMLMediaElement bestMediaElementForShowingPlaybackControlsManager(PlaybackControlsPurpose purpose);
718     [Conditional=VIDEO] MediaSessionState mediaSessionState(HTMLMediaElement element);
719
720     DOMString ongoingLoadsDescriptions();
721     void setCaptureExtraNetworkLoadMetricsEnabled(boolean value);
722
723     void reloadWithoutContentExtensions();
724
725     void setUseSystemAppearance(boolean value);
726
727     unsigned long pluginCount();
728
729     void notifyResourceLoadObserver();
730
731     unsigned long primaryScreenDisplayID();
732
733     boolean capsLockIsOn();
734
735     boolean supportsVCPEncoder();
736
737     HEVCParameterSet? parseHEVCCodecParameters(DOMString codecParameters);
738
739     sequence<CookieData> getCookies();
740
741     void setAlwaysAllowLocalWebarchive(boolean alwaysAllowLocalWebarchive);
742 };