Skip to content

Truly independent web browser

38.1 KB
Raw Blame
[Exposed=Nobody]
interface Internals {

    // These members deliberately remain unimplemented to test [FIXME] binding generation.
    [FIXME] undefined unimplementedOperationForTesting();
    [FIXME] readonly attribute boolean unimplementedAttributeForTesting;

    undefined signalTestIsDone(DOMString text);
    undefined setTestTimeout(double milliseconds);
    undefined forceIncompatibleVisualContextTreeRebuild();
    undefined setForceDarkEnabled(boolean enabled);
    undefined setShowLineBoxBorders(boolean enabled);
    undefined setForceDarkThresholds(long foreground, long background);
    // The nodes of the visual context tree the box of the element owns, one per line as the tree dump describes them
    // with their indices, then whether the box needs a compositor effects layer or a compositor background-color frame.
    DOMString dumpVisualContextNodes(Element element);
    // The animations the compositor runs for the document, one per line, sorted, as the property it animates and the
    // element of the box it drives, then whether their timing anchors differ or one drives no live node, and which of
    // the document's compositor animation timers are armed.
    DOMString dumpCompositorAnimations();
    undefined sendMismatchedVisualContextTreeUpdateToCompositor();
    undefined loadReferenceTestMetadata();

    readonly attribute boolean hasCompletedInitialPaint;
    readonly attribute boolean initialPaintHadPendingFonts;
    // Whether any image this document fetched is still loading or decoding.
    readonly attribute boolean hasPendingImageLoads;
    // Whether the user edited a text control or an editing host in this document.
    readonly attribute boolean hadUserEdits;
    // Freezes the font display clock at the given elapsed time, without starting a font load.
    undefined setFontDisplayTime(FontFace fontFace, unsigned long milliseconds);
    DOMString setTimeZone(DOMString timeZone);

    undefined gc();

    // How many worker agents are alive in this process. One that a worker's owner let go of still counts until its
    // thread has shut it down.
    unsigned long workerAgentCount();
    // Collects garbage once the current task is over. With moveCells, the collection moves every cell it can.
    [CreatesPromise] Promise<undefined> gcAsync(optional boolean moveCells = false);
    // Discards every decoded image frame that can be decoded again, and returns how many were discarded.
    unsigned long long discardDecodedImageFrames();
    // Clears a named environment binding and forces its current cell to be treated as garbage.
    // This does not work for values stored only in optimized locals or registers.
    undefined markAsGarbage(DOMString variableName);
    boolean wrapperIsPreserved(object object);
    // Asks the global of the given document, or else the global of the object's realm.
    boolean hasPendingActivity(object object, optional Document document);
    unsigned long long messagePortPendingOutgoingMessageCount(MessagePort port);
    // Whether the collection holds the elements it collected, which a mutation that may change them discards.
    boolean htmlCollectionHasValidCache(HTMLCollection collection);
    undefined failNextMessagePortTransfer(MessagePort port);
    boolean messagePortsAreDirectlyEntangled(MessagePort first, MessagePort second);
    DOMString messagePortEntanglementKind(MessagePort port);
    // True once the transport of the port closed, as it does when the port sees that its peer went.
    boolean messagePortTransportIsClosed(MessagePort port);
    XMLHttpRequest createXMLHttpRequestForDocument(Document document);
    [ImplementedAs=hit_test_result] object hitTest(double x, double y);
    object? takeContextMenuRequest();
    // Enters or exits Picture-in-Picture for the media context menu's video, as the menu's item does.
    undefined toggleMediaContextMenuPictureInPicture();

    // Spellchecking
    undefined addSpellingErrorForTesting(Node node, unsigned long start, unsigned long end);
    DOMString spellingErrorRanges(Node node);
    Promise<DOMString> checkSpellingForTesting(DOMString text);
    Promise<undefined> spellCheckSettled();

    // Translation
    undefined translatePage(DOMString targetLanguage);
    Promise<undefined> translationSettled();

    // Writing suggestions
    Promise<DOMString> requestWritingSuggestionForTesting(DOMString text, unsigned long caretOffset);
    DOMString writingSuggestion();
    Promise<undefined> writingSuggestionSettled();
    Promise<undefined> writingSuggestionRequestSent();
    Promise<DOMString> activateSpellingMenuItem(SpellingMenuItem item, optional unsigned long guessIndex = 0);

    const unsigned short MOD_NONE = 0;
    const unsigned short MOD_ALT = 1;
    const unsigned short MOD_CTRL = 2;
    const unsigned short MOD_SHIFT = 4;
    const unsigned short MOD_SUPER = 8;
    const unsigned short MOD_KEYPAD = 16;

    const unsigned short MOD_PLATFORM_CTRL = 10; // MOD_CTRL | MOD_SUPER

    const unsigned short BUTTON_LEFT = 0;
    const unsigned short BUTTON_MIDDLE = 1;
    const unsigned short BUTTON_RIGHT = 2;

    undefined sendText(HTMLElement target, DOMString text, optional unsigned short modifiers = 0);
    undefined sendTextThroughUIProcess(DOMString text);
    undefined sendKeyThroughUIProcess(DOMString keyName);
    undefined grantTransientActivation();
    // These send input as the UI process would send the user's, after the compositor has every frame rendered so far,
    // and resolve once the UI process reports that the input has been handled.
    [CreatesPromise] Promise<undefined> clickThroughUIProcess(double x, double y);
    [CreatesPromise] Promise<undefined> mouseEventThroughUIProcess(MouseEventThroughUIProcessType type, double x, double y, optional MouseEventThroughUIProcessOptions options = {});
    // Performs a WebDriver action sequence, given as the JSON parameters of Perform Actions, through the UI process.
    [CreatesPromise] Promise<undefined> performActions(DOMString actions);
    [CreatesPromise] Promise<undefined> wheelThroughUIProcess(double x, double y, double deltaX, double deltaY, optional boolean precise = false, optional ScrollGesturePhase scrollGesturePhase = "none", optional WheelTicks ticks = {});
    undefined sendKey(HTMLElement target, DOMString keyName, optional unsigned short modifiers = 0, optional unsigned long repeatCount = 1);
    undefined sendTextEditingCommand(HTMLElement target, DOMString commandName, optional boolean extendSelection = false);
    undefined paste(HTMLElement target, DOMString text);
    undefined pasteFromClipboard();
    undefined commitText();

    // Low-level mouse primitives
    undefined mouseDown(double x, double y, optional unsigned short clickCount = 1, optional unsigned short button = 0, optional unsigned short modifiers = 0, optional unsigned short buttons);
    undefined mouseUp(double x, double y, optional unsigned short button = 0, optional unsigned short modifiers = 0, optional unsigned short buttons = 0);
    undefined mouseMove(double x, double y, optional unsigned short modifiers = 0, optional unsigned short buttons = 0);
    undefined mouseLeave();
    undefined mouseCancel();

    // High-level mouse conveniences
    undefined click(double x, double y, optional unsigned short clickCount = 1, optional unsigned short button = 0, optional unsigned short modifiers = 0);
    undefined clickAndHold(double x, double y, optional unsigned short clickCount = 1, optional unsigned short button = 0, optional unsigned short modifiers = 0);
    [CreatesPromise] Promise<undefined> wheel(double x, double y, double deltaX, double deltaY, optional boolean precise = false, optional ScrollGesturePhase scrollGesturePhase = "none", optional WheelTicks ticks = {});
    // The scrolling state the compositor has installed from the frames rendered so far, its wheel routing admission,
    // and where, in CSS pixels, it presents the scroller and how far past the edges of its scroll range. The scroller
    // is the viewport if none is given.
    object compositorScrollState(optional Element? scroller = null);
    undefined pinch(double x, double y, double scaleDelta, optional unsigned short modifiers = 0);
    // Sends a pinch through the UI process as it sends the user's, so that the compositor zooms for it if it can.
    undefined pinchThroughUIProcess(double x, double y, double scaleDelta, optional boolean continuesGesture = false);
    undefined resetZoom();

    // The URL of the link the page asks its client to show as hovered, or null when it shows none.
    DOMString? hoveredLink();
    DOMString currentCursor();
    // The color of one pixel of the current image cursor's bitmap, or null when the cursor is no image.
    DOMString? currentCursorPixel(long x, long y);
    DOMString themeColor();

    // Returns the text that would be placed on the clipboard if the user copied the current selection now.
    // Excludes nodes whose used value of user-select is 'none' — mirroring what browsers actually copy.
    DOMString selectedTextForClipboard();

    undefined findInPage(DOMString query, optional boolean highlightAll = false);
    undefined findInPageNextMatch();
    undefined findInPageEnd();

    undefined setClipboardFile(DOMString name, DOMString mimeType, DOMString data);

    // Test-only entry point for the browser's "Copy Link to Highlight" generator.
    DOMString? generateTextFragmentURL(Range range, USVString currentURL);
    DOMString devtoolsGrip(any value);
    DOMString devtoolsProperties(any value);
    DOMString devtoolsLog(sequence<any> arguments);
    DOMString devtoolsLoggedProperties(unsigned long long objectId);
    DOMString devtoolsLogTable(object tableData);
    // Whether errors keep long stack traces, as they do while a DevTools client or a WebDriver BiDi session is attached.
    undefined setLongStackTracesEnabled(boolean enabled);
    sequence<DOMString>? completeConsoleInput(DOMString input);

    // Drive marked/preedit-text composition via the same path platform input methods use. setMarkedTextFromInputMethod
    // updates the inline preedit — replacing any previous preedit. commitText finalizes the composition with the given
    // text. unmarkText finalizes the composition — leaving the current preedit in place. Each fires an InputEvent with
    // inputType = "insertText" on the focused editable. All are no-ops if nothing editable is focused.
    undefined setMarkedTextFromInputMethod(DOMString text);
    undefined commitTextFromInputMethod(DOMString text, optional long replacementStart = 0, optional long replacementLength = 0);
    undefined unmarkTextFromInputMethod();

    // Returns the bounds of the current text caret in viewport-relative CSS pixels — or null if no editable element is
    // focused. Used for verifying the data the platform UI feeds into IME overlay positioning.
    DOMRect? currentCaretRect();

    boolean dispatchUserActivatedEvent(EventTarget target, Event event);
    undefined spoofCurrentURL(USVString url);
    // Gives the document the URL's origin in this process only, as a compromised process would claim it.
    undefined spoofCurrentOriginInThisProcess(USVString url);
    // Sets the navigator compatibility mode of this process; the realms created afterwards expose what that mode has.
    undefined setNavigatorCompatibilityMode(InternalsNavigatorCompatibilityMode mode);

    // Loads a URL in the top-level traversable — deferred so it starts outside the calling task and can land between
    // session-history traversal-queue steps, as can one requested by ConnectionFromClient::load_url in the UI process.
    undefined loadURL(USVString url);

    InternalAnimationTimeline createInternalAnimationTimeline();

    undefined simulateDragStart(double x, double y, DOMString mimeType, DOMString contents);
    undefined simulateDragMove(double x, double y);
    undefined simulateDrop(double x, double y);

    undefined expireCookiesWithTimeOffset(long long seconds);
    // Clears this document's local ("local") or session ("session") storage the way the browser does, through its jar.
    undefined clearStorageForTesting(DOMString type);
    Promise<undefined> deleteAllCookies();
    boolean hasCookieForURL(DOMString url, ByteString name, ByteString value);

    boolean setHttpMemoryCacheEnabled(boolean enabled);
    // Whether two functions run the same compiled code, which compiles them if they did not run yet.
    boolean functionsShareCode(any a, any b);
    // Whether a classic script from the given URL is in the compiled script cache for this window's partition.
    boolean compiledScriptCacheContains(DOMString url);
    boolean setDiskCacheEnabledForNavigations(boolean enabled);
    undefined simulateRequestServerConnectionLoss();
    undefined simulateWorkerRequestServerConnectionLoss();
    undefined sendBadIpcMessageForTesting(DOMString kind);
    undefined setContentBlockers(DOMString patterns);
    undefined setSiteCompatibilityData(DOMString source);
    undefined setContentBlockingEnabled(boolean enabled);
    // Traces the layout passes of the document until takeLayoutTrace(), and its layout tree builds where asked.
    undefined beginLayoutTrace(optional LayoutTraceOptions options = {});
    undefined updateLayoutForTesting();
    DOMString takeLayoutTrace();
    undefined beginDisplayListTrace();
    DOMString takeDisplayListTrace();
    // Traces what the updates of the visual context tree do until takeVisualContextTrace(), which answers one block per
    // update: its scope, then a line per node of a box it allocated, repurposed, updated or released, and whether it
    // gave the tree a new structural epoch or needs a new recording. Updates run by the render clock are not traced.
    undefined beginVisualContextTrace();
    DOMString takeVisualContextTrace();
    // Lays out and brings the visual context tree up to date, as a read of paint properties does.
    undefined updateVisualContextsForTesting();
    // Asks for the owners of no nodes of the visual context tree, as the layers window does without updating style or
    // layout first, and answers the structural epoch of the tree the answer is for: 0 for none yet.
    unsigned long long describeOwnersOfVisualContextNodes();
    // Records where the compositor and this process route each input event, and why, until takeInputTrace().
    undefined beginInputTrace();
    object takeInputTrace();
    // Where the first step of a wheel gesture at the position would go, and why: as the compositor routes it with the
    // frames rendered so far, and as the display list this document last recorded routes it. Neither knows of a gesture
    // in progress.
    object compositorWheelTargetAt(double x, double y, double deltaX, double deltaY);
    object recordedDisplayListWheelTargetAt(double x, double y, double deltaX, double deltaY);
    // Whether the display list this document last recorded has blocking wheel event listeners take a wheel at the
    // position.
    boolean recordedDisplayListBlocksWheelEventAt(double x, double y);
    [ImplementedAs=recorded_async_scrolling_state_object] object recordedAsyncScrollingState();
    undefined recordDisplayListForTesting(optional boolean paintOverlay = false, optional boolean cold = false, optional boolean finestRuns = false);
    undefined setAutoplayPolicy(DOMString policy);

    DOMString getComputedRole(Element element);
    DOMString getComputedLabel(Element element);
    DOMString getComputedAriaLevel(Element element);
    undefined setAccessibilityFocusTarget(Element element);
    undefined setAccessibilityInterested();
    unsigned short getEchoServerPort();
    unsigned short getHttpsEchoServerPort();

    undefined setHSTSPolicy(DOMString domain, unsigned long long maxAge, boolean includeSubDomains);
    undefined ingestHSTSHeader(USVString url, DOMString headerValue);
    boolean isKnownHSTSHost(DOMString domain);

    undefined setBrowserZoom(double factor);
    undefined setDevicePixelRatio(double ratio);
    undefined resizeWindow(long width, long height);

    readonly attribute boolean headless;
    readonly attribute boolean screenWakeLockActive;
    readonly attribute DOMString pictureInPictureWindowState;

    readonly attribute boolean needsRepaint;
    readonly attribute boolean needsDisplayListRecord;
    readonly attribute boolean hasAnimationFrameCallbacks;

    DOMString dumpDisplayList(optional DisplayListDumpOptions options = {});
    // What changed in the display list since the previous call for the document, which the first call only summarizes.
    DOMString dumpDisplayListChanges(optional DisplayListDumpOptions options = {});
    DOMString dumpAccessibilityTree();
    // The per-character offsets that the accessibility tree reports for a text node, as space-separated "x,y" pairs.
    DOMString accessibilityCharacterOffsets(Node node);
    // The accessibility node data the UI process receives for a node and its exposed descendants, one line per node.
    DOMString dumpAccessibilityNodeData(Node node);
    // Each accessible name or description kept between builds of the accessibility tree that differs from what
    // computing it again gives, one per line. Empty when every one is current.
    DOMString accessibilityCachedTextMismatches();
    // Each node whose accessibility data kept between builds of the tree differs from what computing it again gives,
    // one per line. Empty when all of it is current.
    DOMString accessibilityCachedRecordMismatches();
    DOMString accessibilityCachedGeometryMismatches();
    DOMString accessibilityChangeTrackingMismatches();
    DOMString accessibilityLastChangeSize();
    DOMString dumpLayoutTree(Node node);
    DOMString dumpStackingContextTree();
    DOMString stackingContextStructureVerificationReport();
    DOMString dumpGCGraph();
    DOMString heapCensus();
    DOMString dumpSessionHistory();
    DOMString dumpUIProcessSessionHistory();
    DOMString dumpUIProcessSessionHistoryWithoutUpdate();
    boolean captureSessionHistorySnapshot();
    boolean restoreCapturedSessionHistorySnapshot();
    boolean recordReportedSessionHistory();
    DOMString dumpReportedSessionHistory();
    DOMString dumpSiteIsolationProcessTree();
    // Reports if the browser process has created a document for the iframe that it hasn't made active yet.
    boolean hasPopulatedDocument(HTMLIFrameElement iframe);
    // Whether the canvas drew content that it has not presented to the compositor yet.
    boolean canvasHasUnpresentedContent(HTMLCanvasElement canvas);
    undefined crashRemoteFrameProcesses();
    long webContentProcessId();
    // The URLs of the documents this process has not collected yet, whether or not they are still displayed.
    sequence<USVString> documentsInThisProcess();
    // Whether the object lives in the realm of a window whose document has been destroyed, which the object keeps alive.
    boolean isInRealmOfDestroyedDocument(object object);
    // Closes this tab as the browser's close button does when it has no beforeunload check to run.
    undefined closeTabThroughUIProcess();
    // Stops loading and reloads as the browser's Stop and Reload buttons do.
    undefined stopLoadingThroughUIProcess();
    undefined reloadThroughUIProcess();
    // Reloads bypassing the HTTP cache, as the browser's Reload Without Cache action does.
    undefined reloadBypassingCacheThroughUIProcess();
    // Traverses the history by a delta as the browser's Back and Forward buttons do, with no source document.
    undefined traverseHistoryThroughUIProcess(long delta);
    Promise<undefined> flushSessionHistoryTraversalQueue();
    // Uses up this navigable's navigations and history updates until the state reset between tests, as if the page had
    // just made as many as the rate limit allows.
    undefined exhaustNavigationRateLimit();

    boolean hasHTMLParserEndState(Document document);
    boolean htmlParserBodyIsExhausted(Document document);

    boolean hasShadowRoot(Element element);

    // Returns the shadow root of the element, if it has one, even if it's not normally accessible to JS.
    ShadowRoot? getShadowRoot(Element element);

    undefined pumpGamepadEvents();

    undefined setEnvironmentsTopLevelURL(USVString url);
    undefined setGeolocationEmulatedPosition(double latitude, double longitude, optional double accuracy = 100, optional double? altitude = null, optional double? altitudeAccuracy = null, optional double? heading = null, optional double? speed = null);
    undefined setGeolocationEmulatedPositionUnavailable();

    Promise<DOMString> requestPermission(DOMString name);
    Promise<undefined> setPermission(DOMString name, DOMString state);
    undefined setNextPermissionPromptOutcome(DOMString name, DOMString outcome, optional boolean held = false);
    undefined setSystemMicrophoneAuthorization(DOMString authorization, optional DOMString answer = "authorized", optional boolean held = false);
    undefined releaseSystemMicrophoneAnswer();
    DOMString microphoneState();
    // Whether this process has a capture waiting on the AudioServer for its device.
    boolean audioCaptureIsPending();
    undefined releaseHeldPermissionPrompt(optional unsigned long waiters = 1);
    Promise<undefined> advancePermissionClock(unsigned long long milliseconds);
    sequence<DOMString> permissionCacheOrigins();

    // What the UI process's recording notification backend has seen, as JSON: the notifications shown (with the
    // browser's id of each), the ids closed, the pages focused by a click, and the URLs opened by a click on a
    // notification whose page was gone. "{}" outside test-web.
    DOMString notificationsStateForTesting();
    // Acts on a shown notification as the user would: by its Notification object, or by the browser's id, for a
    // notification whose page is gone.
    undefined clickNotificationForTesting(Notification notification);
    undefined clickNotificationByIdForTesting(unsigned long long browserNotificationId);
    undefined dismissNotificationForTesting(Notification notification);
    // Makes the platform hold the next notification the page shows, neither showing nor closing it, until it's told to
    // refuse it.
    undefined holdNextNotificationShowForTesting();
    undefined failHeldNotificationShowForTesting();

    InternalGamepad connectVirtualGamepad();

    undefined setHighlightedNode(Node? node);

    undefined clearElement(HTMLElement element);


    // Records what the rendering of the window agent does until takeRenderingTrace(), one event per line, a run of the
    // same event as one line with how many times it ran: rendering update requests, opportunities, updates and paints,
    // and the animation, compositor, style stabilization and environment work of its documents.
    undefined beginRenderingTrace();
    DOMString takeRenderingTrace();
    undefined setManualRenderingOpportunities(boolean enabled);
    undefined injectRenderingOpportunity(double frameTimeMs);
    // Hands the clock lanes of the current document a tick at the given time, and waits until it has run.
    // With a viewport scroll offset, the compositor had scrolled the viewport down to it at the tick.
    undefined injectClockTick(double frameTimeMs, optional double viewportScrollY);
    // As injectClockTick(), with the compositor having scrolled the given element to the given offset, in CSS pixels.
    undefined injectClockTickScrollingElement(double frameTimeMs, Element scroller, double x, double y);
    // Hands the clock lanes of the current document a pointer move to the given point in CSS pixels as the compositor
    // would, beside the mouse event with the given input event id, if any, and waits until the tick that hovers what is
    // under it has run, at the given frame time, or now.
    undefined injectHoverPointer(double x, double y, optional double frameTimeMs, optional unsigned long long inputEventId, optional unsigned long buttons = 0);
    // Hands the clock lanes of the current document the pointer leaving it, and waits as injectHoverPointer() does.
    undefined injectHoverPointerLeft(double frameTimeMs);
    // Reports to the current document's navigable, as the compositor would, that a frame of a transform animation it
    // runs moved content under the pointer at rest, or away from it, as of the given frame time.
    undefined noteAnimatedContentMovedUnderPointer(double frameTimeMs);
    undefined injectPointerRestsOnMovingContent(double frameTimeMs);
    // Queues a mouse move to the given point in CSS pixels, with the given mouse buttons held, as the UI process would
    // send it, which the next rendering update handles, and answers its input event id.
    unsigned long long queueMouseMove(double x, double y, optional unsigned long buttons = 0);
    // Hands the clock lanes of the current document a pointer move to the given point in CSS pixels as the compositor
    // would, beside the mouse event with the given input event id, if any, which waits for the tick a test injects to
    // hover what is under it.
    undefined moveHoverPointer(double x, double y, optional unsigned long long inputEventId);
    // What the clock lane of the document's presented frame does: "none" where there is none, "ticking" while it samples
    // animations, "parked" once a tick parked it, and "hovering" where it samples no animation and only follows the
    // pointer.
    DOMString clockLaneState(Document document);
    // Whether the lane of a frame the document sampled after the one it presented last has yet to come together.
    boolean clockLaneIsComing(Document document);
    // The color, as a CSS color string, that the box of the element, or of its "::before", "::after" or "::marker"
    // pseudo-element, showed in the last frame a tick of a clock lane presented where the tick restyled it, or null.
    DOMString? presentedColor(Element element, optional DOMString pseudoElement);
    // The text and elements the selection highlights in the fork of the document's clock lane, joined by " | ", each
    // with the colors its ::selection styles give it, if any.
    DOMString presentedSelection();
    // The text and elements the selection highlights in what the host paints, joined by " | ", each with the colors its
    // ::selection styles give it, if any.
    DOMString paintedSelection();
    // The border box of the element in the last frame a clock tick presented.
    DOMRect? presentedBorderBox(Element element);
    // The scroll position in CSS pixels the last frame a clock tick presented was recorded with, or null if the frame
    // had no scroll node for the element.
    DOMPointReadOnly? presentedScrollOffset(Element scroller);
    // The properties compositor animations drove on the box of the element in the last frame a clock tick presented, or
    // null where the frame showed no border box of it.
    sequence<DOMString>? presentedCompositorAnimations(Element element);
    // The opacity the visual contexts of the box of the element gave it in the last frame a clock tick presented, or
    // null where the frame showed no border box of it.
    double? presentedOpacity(Element element);
    // "laying-out" while a rendering update's layout runs beside the event loop, or has and the update has not run its
    // steps after it yet, "in-flight" while a rendering update's frame or recording flies beside the event loop,
    // "landed" once the event loop took the frame in and the update has not run its steps from its style and layout on
    // yet, "idle" otherwise.
    DOMString frameSchedulerState();
    // Waits until the compositor has received every frame already rendered for this page in this process. This does
    // not start a rendering update or wait for frames hosted by another process.
    undefined synchronizeCompositor();
    // Keeps the next recording that flies in flight, before it reads its frame, until releaseHeldFrame(), or until a
    // read waits for it. With "layout", only the next rendering update's layout that flies, or recording, is held,
    // before it reads anything. With "style", the next style update that flies is held, before it reads anything.
    // With "claim", the Render thread does not begin the next style update that flies, which the read that waits for it
    // takes back and runs itself, and the event loop treats its rendering update as it treats any other.
    undefined holdNextFrame(optional DOMString hold = "");
    // What presented the last frame of the document's navigable: "commit" for a frame a rendering update committed,
    // "clock" for a tick of the document's clock lane, or "none" before the first frame.
    DOMString lastFramePresentedBy(Document document);
    // Whether the last frame of the page handed the compositor the keyboard scroll state the page holds now.
    boolean lastFrameKeyboardScrollStateIsCurrent();
    undefined releaseHeldFrame();
    // Whether the rendering update in flight holds back the tasks of the document, as it does where no test holds it.
    boolean renderingUpdateHoldsTasksOf(Document document);
    undefined updateCompositorAnimations();
    boolean runEmptyAnimationStyleUpdateForTesting();
    undefined armCompositorAnimationTimersForTesting();
    undefined fireCompositorAnimationWakeupForTesting(double frameTimeMs);
    undefined forceVisualContextTreeRebuildOnNextCompositorAnimationUpdateForTesting();
    undefined requestReentrantAnimationStyleFlushForTesting(Node node);
    // Snapshots the current, incrementally-updated layout tree, rebuilds it from scratch, and
    // returns { matches }, plus { incremental, full } on mismatch. This is a test oracle for
    // incremental tree builds.
    object compareLayoutTreeWithFullRebuild();
    // Makes the next layout update of the document build its layout tree again over the live one, as a full update
    // requested by the engine does, without tearing the tree down first.
    undefined requestFullLayoutTreeUpdate();
    // Makes the layout tree builds and layouts of the document split their work for the style and layout threads
    // however little of it there is, so that tests of a few dozen elements reach every parallel path. It lasts for the
    // life of the document.
    undefined forceParallelLayout();
    // What the style engine and the style updates of the document counted and measured, for the style update capture
    // tools. Tests do not read it: traces and dumps say what the engine did.
    object styleEngineCounters();
    // What the document's style engine holds on the heap, by owner, with the C++ style state its elements hold:
    // { owners: { name: bytes }, elements, styledElements }.
    object styleMemoryReport();
    // What the style engines of the document and the documents in its frames hold on the heap, each allocation counted
    // once however many of them share it.
    unsigned long long styleMemoryOfFrames();
    // Makes the document's render state panic answering this call, which waits for it: the WebContent process crashes.
    undefined panicRenderStateForTesting();
    // Each way what live style holds for the document disagrees with a cold pass over the same inputs, or with the
    // records the host installed, one per element or pseudo-element. Empty where they agree.
    sequence<DOMString> styleSelfCheck();
    // Records the passes of live style that the host keeps, until takeStyleTrace(), which answers them one per block: a
    // "style FULL", "style PARTIAL" or "style COLD" line, then a line per element the pass styled, in tree order, with
    // how it came by its record and whether the record changed. A full pass lists only the elements it changed. A
    // "style ANIMATION" block names the elements whose animations the host composed over their records, and a "style
    // PROGRAM" block what the engine did to the rules it styles from.
    undefined beginStyleTrace();
    DOMString takeStyleTrace();
    // Reports a snapshot of StyleEngine's matched rules for the whole document.
    DOMString styleEngineMatchedRules();
    // Every element under the root, the document by default, shadow trees included, one per line in tree order indented
    // by depth: its style record, numbered by first appearance so that elements sharing one show the same number, or "no
    // record". With options, also the custom property environment it computes under, the record its layout node holds,
    // and, per group of its computed style, whether it shares its parent's, holds the default, or which payload it holds.
    DOMString dumpStyleRecords(optional Node? root = null, optional StyleRecordsDumpOptions options = {});
    // Flushes pending style work without forcing layout.
    undefined updateStyle();
    undefined setUserStyle(DOMString source);
    undefined setPreferredColorScheme(DOMString colorScheme);
    // Simulates the window gaining or losing focus (e.g. browser chrome or another window taking focus).
    undefined setPageFocus(boolean hasFocus);
    // Simulates the page being shown or hidden (e.g. switching to another tab). Accepts "visible" or "hidden".
    undefined setSystemVisibilityState(DOMString state);
    // Overrides the interval between the wake-ups a hidden document holds its delayed timers back to (1000 ms by default).
    undefined setHiddenDocumentTimerWakeUpInterval(double milliseconds);
    // Overrides the interval between the wake-ups a hidden document holds its chained timers back to once it has been
    // hidden for the grace period, and that grace period, both in milliseconds (60000 ms and 300000 ms by default).
    undefined setHiddenDocumentIntensiveTimerThrottling(double wakeUpInterval, double gracePeriodOnceLoaded, double gracePeriodWhileLoading);
    // Returns how many timers are armed on the given window (a Window or WindowProxy object).
    unsigned long long activeTimerCount(object window);
    sequence<long> activeTimerIds(object window);
    // Returns how many tasks sit in the main thread event loop's task queue, runnable or not.
    unsigned long long taskQueueLength();
    DOMString canvasColorScheme();
    // The URLs of the shared image requests the given document owns, sorted.
    [ImplementedAs=image_request_urls] sequence<USVString> imageRequestURLs(Document document);
    // Returns the selector-insight cache state for stylesheet invalidation tests.
    object imageAnimationStateForURL(USVString url);
    boolean mediaElementIsFetching(HTMLMediaElement element);
    boolean mediaElementIsPlayingAudio(HTMLMediaElement element);
    any activeMediaSessionState();
    any nowPlayingStateForTesting();
    undefined triggerNowPlayingActionForTesting(MediaSessionAction action, optional object? details = null);
    Promise<undefined> waitForMediaSessionArtwork();
    undefined triggerMediaSessionAction(MediaSessionAction action, optional object? details = null);
    boolean documentIsPlayingAudio(Document document);
    // Whether the UI process shows this window's tab as playing audio: while the AudioServer has recently heard the tab,
    // and for a while after.
    boolean tabIsPlayingAudio();
    // Whether the AudioServer has recently heard this window's tab, whatever the tab shows.
    boolean tabIsHeardPlayingAudio();
    // Whether the UI process shows this window's tab as using the microphone: while the AudioServer holds a capture stream
    // for the tab, and for a while after.
    boolean tabIsUsingMicrophone();
    // Whether the AudioServer holds a capture stream for this window's tab, whatever the tab shows.
    boolean tabIsCapturingAudio();
    // Has the UI process hear of a capture stream of this process whose label names none of its pages.
    undefined reportAudioCaptureOfUnknownPage(boolean capturing);
    // The ID of the page that shows this page's Picture-in-Picture window.
    unsigned long long pictureInPictureWindowPageId();
    // Has the UI process hear of a capture stream of this process labelled for the page, as this process chose to.
    undefined reportAudioCaptureOfPage(unsigned long long pageId, boolean capturing);
    // Has the UI process retire this page's Picture-in-Picture window, as if this process went on to ignore that.
    undefined retirePictureInPictureWindow();
    // How many streams this process's tracks hold of the capture sources it has open.
    unsigned long long audioCaptureStreamCount();
    // Each change of whether the UI process shows this window's tab as playing audio, in order: "shown" or "hidden".
    sequence<DOMString> tabAudibilityTransitions();
    boolean mediaElementVideoSinkIsTicking(HTMLMediaElement element);
    undefined setMediaElementReadyState(HTMLMediaElement element, unsigned short readyState);
    undefined setMediaElementPaused(HTMLMediaElement element, boolean paused);
    undefined setMediaElementSeeking(HTMLMediaElement element, boolean seeking);
    // Closes this process's connection to its media server, which is what a media server crash looks like from here.
    undefined disconnectMediaServer();
    // Closes this process's connection to its AudioServer, which is what an AudioServer crash looks like from here.
    undefined disconnectAudioServer();

    DOMString viewportOverflowX();

    // A byte stream that pulls at most pullSize of the bytes at a time through
    // https://streams.spec.whatwg.org/#readablestream-pull-from-bytes, and closes once it has pulled them all.
    ReadableStream createStreamPullingFromBytes(ByteString bytes, unsigned long pullSize);

};

enum InternalsNavigatorCompatibilityMode { "chrome", "gecko", "webkit" };
enum SpellingMenuItem { "none", "guess", "ignore", "learn" };
enum DisplayListDumpFormat { "text", "jsonl" };
enum ScrollGesturePhase { "none", "ongoing", "momentum", "ended" };
enum MouseEventThroughUIProcessType { "mousedown", "mouseup", "mousemove", "mouseleave" };

dictionary StyleRecordsDumpOptions {
    boolean customPropertyEnvironments = false;
    boolean layout = false;
    boolean groups = false;
};

dictionary DisplayListDumpOptions {
    boolean owners = true;
    boolean text = true;
    boolean fonts = false;
    boolean recordIds = false;
    boolean chunks = false;
    boolean rawNodeIndices = false;
    DisplayListDumpFormat format = "text";
};

dictionary LayoutTraceOptions {
    boolean treeBuilds = false;
};

// How many wheel ticks a wheel step amounts to on each axis. By default, they are counted from the pixel delta.
dictionary WheelTicks {
    double x;
    double y;
};

dictionary MouseEventThroughUIProcessOptions {
    PointerEventInit pointer;
    unsigned short button = 0;
    // The buttons held once the event has happened. By default, the button a mousedown presses, and none otherwise.
    unsigned short buttons;
    unsigned short modifiers = 0;
    unsigned short clickCount = 1;
};