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