Nacre/spikes/webkit-egui/run/seq.sh
astar76 63b39d7b7e webkit-spike: hidden run result, D-035..D-040, plans 08 WebKit engine S044-S055
GTK 4 host + transparent egui GLArea over WebKitGTK proven hidden (Xvfb + nested
niri): pick fall-through, real input and IME, egui menus over video, pacing equal
with and without the overlay. Spike fixes: IM client widget, wl-input Y flip,
SPIKE_EGUI=0 layout, URL trim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 02:01:11 -06:00

35 lines
2.7 KiB
Shell
Executable file

#!/bin/bash
# full spike sequence in the nested session: seq.sh <outdir> [env...]
S=${SPIKE_RUN:-/tmp/webkit-spike}; HERE=$(cd "$(dirname "$0")" && pwd)
O=$1; shift
SOFT="LIBGL_ALWAYS_SOFTWARE=1 WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 GTK_A11Y=none GDK_DEBUG=no-portals GSK_RENDERER=gl NO_AT_BRIDGE=1"
$HERE/spike.sh $O $SOFT "$@"
python3 /home/astar76/Projects/Nacre/tools/engine-test/sample.py --out $O/ram.csv --name '^webkit-egui$' --mark $O/mark --until-gone >$O/sample.log 2>&1 &
source $S/env; export WL_INPUT_FLIP_Y=1
W=$HERE/../target/release/wl-input
c() { echo "$*" >> $O/cmd; }
c mark load; sleep 30; c shot loaded
c 'js v0 (()=>{const v=document.querySelector("video");return JSON.stringify(v&&{t:v.currentTime,rs:v.readyState,p:v.paused})})()'
c mark play; $W winit click 440 360; sleep 5; c stats s0; c sleep 15; c stats play; sleep 16
c 'js v1 (()=>{const v=document.querySelector("video");const q=v.getVideoPlaybackQuality();return JSON.stringify({t:v.currentTime,p:v.paused,frames:q.totalVideoFrames,dropped:q.droppedVideoFrames})})()'
[ "$ONLYSTATS" = 1 ] && { sleep 2; c quit; exit; }
c menu 1; sleep 1; c shot flyout; c pick pick_open 1100 60 1100 120 640 400 600 22; sleep 1
$W winit click 1036 117; sleep 1; c state zoom; c pick pick_closed 1100 60 1100 120 640 400 600 22; sleep 1
$W winit click 400 300 right; sleep 1.5; c state ctx; c shot ctxmenu; sleep 1.5
$W winit click 1200 700; sleep 1; c state ctx_closed
c 'js top0 window.scrollY'; $W winit scroll 640 400 5; sleep 1.5; c 'js top1 window.scrollY'; sleep 1
# URL field: click it, IME preedit+commit, then typing via virtual keyboard
$W winit click 600 22; sleep 0.5; c state urlfocus; sleep 0.5
$W winit click 600 22; sleep 0.3; wtype -M ctrl a -m ctrl; wtype -k BackSpace; sleep 0.3
$W ime 日本 1.0 >$O/ime_url.log 2>&1 & sleep 0.6; c shot ime_preedit_url; sleep 1.2; c state ime_url
wtype ' example.com'; sleep 0.5; c state typed_url; wtype -k Return; sleep 4; c state went; c shot went
# page input
c 'go https://duckduckgo.com/'; sleep 8; c shot ddg
c 'js inp (()=>{const i=document.querySelector("input[name=q]");const r=i.getBoundingClientRect();return JSON.stringify([r.x+r.width/2,r.y+r.height/2])})()'; sleep 1
read X Y < <(python3 -c "import json;a=json.load(open('$O/inp.json'));a=json.loads(a) if isinstance(a,str) else a;print(int(a[0]),int(a[1])+46)")
$W winit click $X $Y; sleep 0.5; wtype 'abc '; $W ime 日本語 1.0 >$O/ime_page.log 2>&1 & sleep 0.6; c shot ime_preedit_page; sleep 1.2
c 'js pageval document.activeElement.tagName+"|"+document.activeElement.value'; sleep 1
# popup + tabs
c menu 1; sleep 0.5; $W winit click 1094 186; sleep 5; c state popup; c shot popup
$W winit click 40 22; sleep 1; c state tab0; c shot tab0
c mark idle2; c sleep 10; c quit