2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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.
27 enum PageOverlayType {
32 // These map to ResourceRequestCachePolicy.
34 "UseProtocolCachePolicy",
35 "ReloadIgnoringCacheData",
36 "ReturnCacheDataElseLoad",
37 "ReturnCacheDataDontLoad"
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"
49 [Conditional=MEDIA_SESSION] enum MediaSessionInterruptingCategory {
55 [Conditional=MEDIA_SESSION] enum MediaControlEvent {
61 enum AutoFillButtonType {
66 "StrongConfirmationPassword"
69 enum UserInterfaceLayoutDirection {
74 enum BaseWritingDirection {
80 enum EventThrottlingBehavior {
86 ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
88 ] interface Internals {
89 DOMString address(Node node);
90 boolean nodeNeedsStyleRecalc(Node node);
91 DOMString styleChangeType(Node node);
92 DOMString description(any value);
94 // Animated image pausing testing.
95 boolean hasPausedImageAnimations(Element element);
97 // Must be called on an element whose enclosingLayer() is self-painting.
98 boolean isPaintingFrequently(Element element);
99 void incrementFrequentPaintCounter(Element element);
101 [MayThrowException] DOMString elementRenderTreeAsText(Element element);
102 boolean isPreloaded(DOMString url);
103 boolean isLoadingFromMemoryCache(DOMString url);
104 DOMString fetchResponseSource(FetchResponse response);
105 DOMString xhrResponseSource(XMLHttpRequest xhr);
106 boolean isSharingStyleSheetContents(HTMLLinkElement a, HTMLLinkElement b);
107 boolean isStyleSheetLoadingSubresources(HTMLLinkElement link);
108 void clearMemoryCache();
109 void pruneMemoryCacheToSize(long size);
110 void destroyDecodedDataForAllImages();
111 long memoryCacheSize();
112 void setOverrideCachePolicy(CachePolicy policy);
113 void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
114 void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
116 void clearPageCache();
117 unsigned long pageCacheSize();
119 CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
121 Node ensureUserAgentShadowRoot(Element host);
122 Node shadowRoot(Element host);
124 // CSS Deferred Parsing Testing.
125 long deferredStyleRulesCount(StyleSheet sheet);
126 long deferredGroupRulesCount(StyleSheet sheet);
127 long deferredKeyframesRulesCount(StyleSheet sheet);
129 [MayThrowException] DOMString shadowRootType(Node root);
130 DOMString shadowPseudoId(Element element);
131 void setShadowPseudoId(Element element, DOMString id);
132 Node treeScopeRootNode(Node node);
133 Node parentTreeScope(Node node);
135 // Spatial Navigation testing
136 [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
138 // CSS Animation testing.
139 unsigned long numberOfActiveAnimations();
140 [MayThrowException] void suspendAnimations();
141 [MayThrowException] void resumeAnimations();
142 [MayThrowException] boolean animationsAreSuspended();
143 [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
144 [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
145 readonly attribute double animationsInterval;
147 // CSS Transition testing.
148 [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
149 [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
151 // For animations testing, we need a way to get at pseudo elements.
152 [MayThrowException] Element? pseudoElement(Element element, DOMString pseudoId);
154 DOMString visiblePlaceholder(Element element);
155 void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
156 [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
157 [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
159 [MayThrowException] DOMRect absoluteCaretBounds();
161 DOMRect boundingBox(Element element);
163 [MayThrowException] DOMRectList inspectorHighlightRects();
164 [MayThrowException] DOMString inspectorHighlightObject();
166 [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
167 [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
168 [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
169 [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
170 void addTextMatchMarker(Range range, boolean isActive);
171 [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
173 void invalidateFontCache();
174 void setFontSmoothingEnabled(boolean enabled);
176 [MayThrowException] void setScrollViewPosition(long x, long y);
178 // Like Element.scrollTo(), but without constaints, for testing rubber-banding.
179 [MayThrowException] void unconstrainedScrollTo(Element element, unrestricted double x, unrestricted double y);
181 [MayThrowException] DOMRect layoutViewportRect();
182 [MayThrowException] DOMRect visualViewportRect();
184 [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
186 [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
187 [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
189 [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
191 [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
192 boolean elementShouldAutoComplete(HTMLInputElement inputElement);
193 void setEditingValue(HTMLInputElement inputElement, DOMString value);
194 void setAutofilled(HTMLInputElement inputElement, boolean enabled);
195 void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
196 AutoFillButtonType autoFillButtonType(HTMLInputElement inputElement);
197 AutoFillButtonType lastAutoFillButtonType(HTMLInputElement inputElement);
199 [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
200 [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
201 [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
203 [MayThrowException] DOMString autofillFieldName(Element formControlElement);
205 [MayThrowException] void paintControlTints();
207 [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
209 Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
210 unsigned long locationFromRange(Element scope, Range range);
211 unsigned long lengthFromRange(Element scope, Range range);
212 DOMString rangeAsText(Range range);
213 Range subrange(Range range, long rangeLocation, long rangeLength);
214 [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
215 Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
217 [MayThrowException] void setDelegatesScrolling(boolean enabled);
219 [MayThrowException] long lastSpellCheckRequestSequence();
220 [MayThrowException] long lastSpellCheckProcessedSequence();
222 sequence<DOMString> userPreferredLanguages();
223 void setUserPreferredLanguages(sequence<DOMString> languages);
225 sequence<DOMString> userPreferredAudioCharacteristics();
226 void setUserPreferredAudioCharacteristic(DOMString characteristic);
228 [MayThrowException] unsigned long wheelEventHandlerCount();
229 [MayThrowException] unsigned long touchEventHandlerCount();
231 [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
232 [MayThrowException] DOMRectList passiveTouchEventListenerRects();
234 [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
235 unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
236 boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
238 // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
239 DOMString parserMetaData(optional any func);
241 void updateEditorUINowIfScheduled();
243 boolean hasSpellingMarker(long from, long length);
244 boolean hasGrammarMarker(long from, long length);
245 boolean hasAutocorrectedMarker(long from, long length);
246 void setContinuousSpellCheckingEnabled(boolean enabled);
247 void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
248 void setAutomaticLinkDetectionEnabled(boolean enabled);
249 void setAutomaticDashSubstitutionEnabled(boolean enabled);
250 void setAutomaticTextReplacementEnabled(boolean enabled);
251 void setAutomaticSpellingCorrectionEnabled(boolean enabled);
253 void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
255 boolean isOverwriteModeEnabled();
256 void toggleOverwriteModeEnabled();
258 unsigned long numberOfScrollableAreas();
260 [MayThrowException] boolean isPageBoxVisible(long pageNumber);
262 unsigned long imageFrameIndex(HTMLImageElement element);
263 void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
264 void resetImageAnimation(HTMLImageElement element);
265 boolean isImageAnimating(HTMLImageElement element);
266 void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
267 unsigned long imageDecodeCount(HTMLImageElement element);
268 unsigned long pdfDocumentCachingCount(HTMLImageElement element);
269 void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
270 void setForceUpdateImageDataEnabledForTesting(HTMLImageElement element, boolean enabled);
272 void setGridMaxTracksLimit(unsigned long maxTracksLimit);
274 readonly attribute InternalSettings settings;
275 readonly attribute unsigned long workerThreadCount;
277 [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
278 [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
280 // Flags for layerTreeAsText.
281 const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
282 const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
283 const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
284 const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
285 const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
286 const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
287 const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
288 [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
290 [MayThrowException] unsigned long long layerIDForElement(Element element);
292 [MayThrowException] DOMString scrollingStateTreeAsText();
293 [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
294 [MayThrowException] DOMRectList nonFastScrollableRects();
296 [MayThrowException] DOMString repaintRectsAsText();
298 // These throw if the element does not have a compositing layer.
299 [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
300 [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
302 // Flags for displayListForElement.
303 const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
304 // Returns the recorded display list.
305 [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
306 // Returns the display list that was actually painted.
307 [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
309 [MayThrowException] void garbageCollectDocumentResources();
311 [MayThrowException] void insertAuthorCSS(DOMString css);
312 [MayThrowException] void insertUserCSS(DOMString css);
314 readonly attribute boolean isUnderMemoryPressure;
315 void beginSimulatedMemoryPressure();
316 void endSimulatedMemoryPressure();
318 unsigned long numberOfLiveNodes();
319 unsigned long numberOfLiveDocuments();
320 unsigned long referencingNodeCount(Document document);
321 WindowProxy? openDummyInspectorFrontend(DOMString url);
322 void closeDummyInspectorFrontend();
323 [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
325 DOMString counterValue(Element element);
326 long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
327 sequence<DOMString> shortcutIconURLs();
328 long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
329 [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
330 [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
332 [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
333 [MayThrowException] float pageScaleFactor();
335 [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
336 [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
338 [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
339 [MayThrowException] void setFixedLayoutSize(long width, long height);
340 void setPrinting(long width, long height);
342 [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
344 void setHeaderHeight(unrestricted float height);
345 void setFooterHeight(unrestricted float height);
347 void setTopContentInset(unrestricted float contentInset);
349 [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
350 [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
351 [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
352 [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
354 void setFullscreenInsetTop(double inset);
355 void setFullscreenAutoHideDelay(double delay);
357 void setApplicationCacheOriginQuota(unsigned long long quota);
359 void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
360 void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
362 void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
364 MallocStatistics mallocStatistics();
365 TypeConversions typeConversions();
366 MemoryInfo memoryInfo();
368 sequence<DOMString> getReferencedFilePaths();
370 // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
371 // startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
372 [MayThrowException] void startTrackingRepaints();
373 [MayThrowException] void stopTrackingRepaints();
375 [MayThrowException] void startTrackingLayerFlushes();
376 [MayThrowException] unsigned long layerFlushCount();
378 // Query if a timer is currently throttled, to debug timer throttling.
379 [MayThrowException] boolean isTimerThrottled(long timerHandle);
381 boolean isRequestAnimationFrameThrottled();
382 boolean areTimersThrottled();
384 [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
385 readonly attribute double requestAnimationFrameInterval;
386 readonly attribute boolean scriptedAnimationsAreSuspended;
388 // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
389 attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
391 [MayThrowException] void startTrackingStyleRecalcs();
392 [MayThrowException] unsigned long styleRecalcCount();
393 readonly attribute unsigned long lastStyleUpdateSize;
395 [MayThrowException] void startTrackingCompositingUpdates();
396 [MayThrowException] unsigned long compositingUpdateCount();
398 // |node| should be Document, HTMLIFrameElement, or unspecified.
399 // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
400 // specified without security checks. Unspecified or null means this document.
401 [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
403 readonly attribute unsigned long layoutCount;
405 // Returns a string with information about the mouse cursor used at the specified client location.
406 [MayThrowException] DOMString getCurrentCursorInfo();
408 DOMString markerTextForListItem(Element element);
410 DOMString toolTipFromElement(Element element);
412 SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
413 ArrayBuffer serializeObject(SerializedScriptValue object);
415 boolean isFromCurrentWorld(any obj);
417 void setUsesOverlayScrollbars(boolean enabled);
418 void setUsesMockScrollAnimator(boolean enabled);
420 void forceReload(boolean endToEnd);
421 void reloadExpiredOnly();
423 void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
425 [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
426 [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
427 [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
428 [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
429 [Conditional=VIDEO] void beginSimulatedHDCPError(HTMLMediaElement media);
430 [Conditional=VIDEO] void endSimulatedHDCPError(HTMLMediaElement media);
432 [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
433 [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
435 [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
437 DOMString getImageSourceURL(Element element);
439 [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
440 [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
441 [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
442 [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
444 [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
446 [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
448 boolean isSelectPopupVisible(HTMLSelectElement element);
450 [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
451 [MayThrowException] DOMString unavailablePluginReplacementText(Element element);
452 boolean isPluginSnapshotted(Element element);
454 [MayThrowException] DOMRect selectionBounds();
456 [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
457 [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
458 [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
459 [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
461 [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
462 [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
463 [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
464 [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
465 [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
466 [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
467 [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
468 [Conditional=VIDEO] void applicationWillBecomeInactive();
469 [Conditional=VIDEO] void applicationDidBecomeActive();
470 [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
471 [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
472 [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
473 [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
474 [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
475 [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
476 [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
477 [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
478 [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
479 [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
481 [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
482 [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
483 [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
484 [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
485 [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
487 [Conditional=VIDEO] void simulateSystemSleep();
488 [Conditional=VIDEO] void simulateSystemWake();
489 [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
491 [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
492 [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
494 void setPageMuted(DOMString mutedState);
495 DOMString pageMediaState();
497 void setPageDefersLoading(boolean defersLoading);
498 [MayThrowException] boolean pageDefersLoading();
500 File? createFile(DOMString url);
501 void queueMicroTask(long testNumber);
502 boolean testPreloaderSettingViewport();
504 [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
506 [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
507 [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
509 [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
511 [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
513 DOMString userVisibleString(DOMURL url);
515 void setShowAllPlugins(boolean showAll);
517 [Conditional=STREAMS_API, CallWith=ScriptState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
518 [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream);
520 DOMString resourceLoadStatisticsForOrigin(DOMString domain);
521 void setResourceLoadStatisticsEnabled(boolean enable);
522 [EnabledBySetting=StorageAccessAPI] void setUserGrantsStorageAccess(boolean value);
524 [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
526 DOMString composedTreeAsText(Node parent);
528 boolean isProcessingUserGesture();
529 double lastHandledUserGestureTimestamp();
531 void withUserGesture(VoidCallback callback);
533 GCObservation? observeGC(any observed);
535 void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
536 void setBaseWritingDirection(BaseWritingDirection direction);
538 boolean userPrefersReducedMotion();
540 void reportBacktrace();
542 [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
543 [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
545 sequence<DOMString> accessKeyModifiers();
547 void setQuickLookPassword(DOMString password);
549 [CallWith=Document] void setAsRunningUserScripts();
551 void disableTileSizeUpdateDelay();
552 void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
554 [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
555 [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
557 void setPageVisibility(boolean isVisible);
559 [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
560 [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
562 [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
563 [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
564 [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
565 [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
566 [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
567 [Conditional=MEDIA_STREAM, MayThrowException] void setMediaDeviceState(DOMString deviceID, DOMString property, boolean value);
568 [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
569 [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
570 [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
571 [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
572 [Conditional=MEDIA_STREAM] void setMediaStreamTrackIdentifier(MediaStreamTrack track, DOMString identifier);
574 Promise<void> clearCacheStorageMemoryRepresentation();
575 Promise<DOMString> cacheStorageEngineRepresentation();
576 void setResponseSizeWithPadding(FetchResponse response, unsigned long long size);
577 unsigned long long responseSizeWithPadding(FetchResponse response);
579 void setConsoleMessageListener(StringCallback callback);
581 DOMString audioSessionCategory();
583 [Conditional=SERVICE_WORKER] Promise<boolean> hasServiceWorkerRegistration(DOMString scopeURL);
584 [Conditional=SERVICE_WORKER] void terminateServiceWorker(ServiceWorker worker);
585 [Conditional=SERVICE_WORKER] boolean hasServiceWorkerConnection();
587 void testIncomingSyncIPCMessageWhileWaitingForSyncReply();
589 [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline);
590 [EnabledAtRuntime=WebAnimations] void pauseTimeline(AnimationTimeline timeline);
591 [EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime);
592 [Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
593 [Conditional=WEB_AUTHN] readonly attribute MockCredentialsMessenger mockCredentialsMessenger;
595 DOMString systemPreviewRelType();
596 boolean isSystemPreviewLink(Element element);
597 boolean isSystemPreviewImage(Element element);
599 boolean usingAppleInternalSDK();