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