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