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