ladybird/Libraries/LibWeb/Internals/Internals.idl
Andreas Kling f9ef74bb0a LibWeb: Stabilize style invalidation counter tests
Counter tests reset their counters before measured mutations, but setup
and cleanup could leave pending style invalidation work behind. A later
case could then pay for stale work in its measured counter window. That
made exact recomputation baselines depend on prior test order.

Add a test-only Internals hook that flushes pending style work without
forcing layout. Use it to make warm counter measurements start from a
clean style state. Cold paths keep using a plain counter reset so they
still exercise cold rule-cache behavior.

Rebaseline these counter tests now that they no longer include cleanup
work from previous cases.
2026-05-23 22:03:46 +02:00

108 lines
4.7 KiB
Text

[Exposed=Nobody]
interface Internals {
undefined signalTestIsDone(DOMString text);
undefined setTestTimeout(double milliseconds);
undefined loadReferenceTestMetadata();
undefined loadTestVariants();
DOMString setTimeZone(DOMString timeZone);
undefined gc();
Promise<undefined> gcAsync();
// 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);
object hitTest(double x, double y);
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 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 sendKey(HTMLElement target, DOMString keyName, optional unsigned short modifiers = 0);
undefined paste(HTMLElement target, Utf16DOMString text);
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);
undefined mouseUp(double x, double y, optional unsigned short button = 0, optional unsigned short modifiers = 0);
undefined mouseMove(double x, double y, optional unsigned short modifiers = 0);
// 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);
Promise<undefined> wheel(double x, double y, double deltaX, double deltaY);
undefined pinch(double x, double y, double scaleDelta);
DOMString currentCursor();
boolean dispatchUserActivatedEvent(EventTarget target, Event event);
undefined spoofCurrentURL(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);
boolean setHttpMemoryCacheEnabled(boolean enabled);
undefined setContentBlockers(DOMString patterns);
undefined setContentBlockingEnabled(boolean enabled);
DOMString getComputedRole(Element element);
DOMString getComputedLabel(Element element);
DOMString getComputedAriaLevel(Element element);
unsigned short getEchoServerPort();
undefined setBrowserZoom(double factor);
undefined setDevicePixelRatio(double ratio);
readonly attribute boolean headless;
DOMString dumpDisplayList();
DOMString dumpLayoutTree(Node node);
DOMString dumpPaintableTree(Node node);
DOMString dumpStackingContextTree();
DOMString dumpGCGraph();
DOMString dumpSessionHistory();
// 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 handleSDLInputEvents();
undefined setEnvironmentsTopLevelURL(USVString url);
InternalGamepad connectVirtualGamepad();
undefined setHighlightedNode(Node? node);
undefined clearElement(HTMLElement element);
// Returns a snapshot of the style-invalidation and recomputation counters for the current document.
// Keys include hasAncestorWalkInvocations, styleInvalidations, elementStyleRecomputations, and
// elementStyleNoopRecomputations.
object getStyleInvalidationCounters();
undefined resetStyleInvalidationCounters();
// Flushes pending style work without forcing layout.
undefined updateStyle();
unsigned long long activeImageStyleValueAnimationCount();
object asyncScrollingState();
boolean asyncScrollingStateBlocksWheelEventAt(double x, double y);
boolean asyncScrollingStateCanWheelScrollAt(double x, double y, double deltaX, double deltaY, optional boolean forceStaleWheelEventRegions = false);
DOMString asyncScrollingStateWheelRoutingAdmission();
DOMString asyncScrollingStateWheelScrollAdmissionAt(double x, double y, double deltaX, double deltaY, optional boolean forceStaleWheelEventRegions = false);
DOMString asyncScrollingStateWheelTargetAt(double x, double y, double deltaX, double deltaY);
};