Skip to content

fix(input): preserve activation and navigation lifecycle semantics - #757

Closed
lanyue-llk wants to merge 1 commit into
codex/pr640-reopen-layoutfrom
codex/pr640-reopen-input
Closed

lanyue-llk wants to merge 1 commit into
codex/pr640-reopen-layoutfrom
codex/pr640-reopen-input

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Enter 已送达输入框却没有触发表单默认提交;点击或按键触发导航后,旧页面收尾事件又可能被当作失败。WebDriver 适配还需与原生输入共享焦点、命中和默认激活语义。本 PR 将协议转换留在适配层,将真实输入与默认动作保留在核心输入层。

一图看懂

PR #757 · 默认激活与导航收尾

图示说明问题、修复机制与行为边界;点击可查看原图。验收归属不等于当前提交通过结果,版本和测试证据见下文。

行为与实现

ClassicClickPreparation 用 Dom / Pointer { point, viewport } 表达两条路径,让指针所需数据随状态携带。点击预检核对遮挡与 frame 祖先;Enter、换行、取消默认动作有各自语义。导航后的收尾按旧事件所属生命周期处理,不能吞掉无关输入错误。类型设计依据 Rust API Guidelines:用类型表达参数语义。

代码阅读路线

  1. moli-protocol-webdriver-classic/src/commands/elements.rs、actions/types,server 的 classic helpers/state:协议校验、点击准备与类型转换。
  2. moli-protocol/src/domains/input.rs、DOM resolve:焦点、命中与事件分派。
  3. renderer 的 script_vm/input_dispatch.rs、element activation/default_action、forms/submission:核心默认动作及导航切换后的收尾。
  4. classic、keyboard_events、forms/event_activation 与 CDP smoke:从外部行为核对上述边界,而非只验证辅助函数返回值。

Case 与回归契约

负责 274,386,465,731;原第 6 类键盘/导航对应 274、465,第 8 类 Enter 搜索对应 731,386 是额外保留的 1.1.8 失败 case。

覆盖 Enter/换行、焦点、preventDefault、遮挡和跨 frame、Mock/真实布局、导航前后的输入失败。历史两项遮挡点击测试在旧输入 HEAD 失败,依赖布局后保持测试不变通过;精确 CI 红绿对照。这说明布局是点击功能的真实前提,不能以 iframe 特例或跳过断言修复。

历史 fa1c36ef558cde8751883bff174dac7417395220 四题按冻结动作和评分单轮 4/4、零重试;验收说明、逐题结果。任务执行前的启动超时与任务重试需区分,失败启动记录仍保留。

此 PR 当前状态为 CLOSED,最后 head faf55d0966aba39622e99253007733618bc60484,base codex/pr640-reopen-layout;上述历史任务结果不应改标为该 head 的新验收。最终提交检查见 Checks,实现来源 #736。历史堆叠依赖与现在剩余三个 PR 的 main base 不相同。

Reviewer 重点

默认动作是否仍可被事件取消?指针路径是否按真实遮挡/frame 关系判断?导航切换后的合法收尾和真实错误是否正确区分?

整组验收与证据入口

这组修复来自 #640,对应 1.1.9 的 34 个失败 case,加上 1.1.8 已失败的 386,共 35 个唯一 case。按最终职责分配为:#756 布局 27、#757 输入 4、#758 网络 3、#761 文本 1;#755、#759、#760 以各自独立功能契约验收,不重复认领这 35 个 case。

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Sequential Navigation Soak A/B

✅ HEAD completed the 200-navigation resilience and memory observation.

One browser process, one target, and one CDP session navigate CSDN → SegmentFault → Huaban → example.com repeatedly. This run issued 200 Page.navigate commands per binary.

Common ancestor ef06d30495 → HEAD faf55d0966; benchmark order: base-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 200 / 200 200 / 200
Failures / recovered 0 / 0 0 / 0
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 290.3 s 303.3 s

A public-page failure is reported separately from an unrecoverable session. The soak requires all navigation attempts, zero failed recovery, zero lifecycle/network ordering violations, and complete resource evidence.

Process-tree memory

Metric Base HEAD Δ
Boundary samples 200 200 0
Boundary RSS samples 200 200 0
Boundary PSS samples 200 200 0
Periodic peak RSS 225.7 MiB 220.5 MiB -5.2 MiB
Periodic peak PSS 221.3 MiB 216.9 MiB -4.4 MiB
RSS · first 10 avg 164.8 MiB 149.1 MiB -15.7 MiB
RSS · last 10 avg 160.2 MiB 159.3 MiB -0.9 MiB
RSS · last − first window -4.6 MiB +10.2 MiB +14.8 MiB
RSS · warm slope / 100 nav +1.1 MiB +1.5 MiB +0.4 MiB
PSS · first 10 avg 161.7 MiB 145.6 MiB -16.1 MiB
PSS · last 10 avg 156.6 MiB 155.7 MiB -0.9 MiB
PSS · last − first window -5.1 MiB +10.1 MiB +15.2 MiB
PSS · warm slope / 100 nav +0.9 MiB +1.1 MiB +0.3 MiB
Peak file descriptors 64 64 0
Peak threads 31 31 0

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 158.7 MiB 150.5 MiB 220.7 MiB 155.6 MiB 147.3 MiB 55
51–100 159.3 MiB 135.7 MiB 178.6 MiB 156.1 MiB 132.1 MiB 53
101–150 162.0 MiB 152.9 MiB 183.2 MiB 158.6 MiB 149.4 MiB 53
151–200 162.3 MiB 144.6 MiB 211.4 MiB 158.7 MiB 140.9 MiB 52

Raw reports and per-navigation boundary samples: workflow run and full sequential-navigation-soak-results artifact.

Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

CI Regression Report

Source CI run · source state at render: in_progress · artifacts: 5/5

Check Status Signal
Release regression ✅ HEAD/base failures 0/0; raw binary +0.014275%
Frontend differential ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes ✅ 8/8 Moli episodes passed; 0 failures
Runtime/CDP contracts ✅ 26 contract cases; 0 failures
CDP smoke ✅ 48/48 groups passed; 535 scenarios
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.014275%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 146.39 MiB 146.41 MiB +21.40 KiB +0.014275%
Stripped binary 100.48 MiB 100.50 MiB +20.00 KiB +0.019439%
gzip binary 50.11 MiB 50.12 MiB +10.14 KiB +0.019769%
Rootfs 153.29 MiB 153.31 MiB +20.00 KiB +0.012741%
gzip rootfs 58.88 MiB 58.89 MiB +9.53 KiB +0.015803%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.17 ms 27.01 ms −0.16 ms 4.42 MiB 5.18 MiB +772.00 KiB
CDP first page 49.04 ms 49.07 ms +0.03 ms 4.22 MiB 3.77 MiB −463.50 KiB
CDP warm page 12.27 ms 12.44 ms +0.16 ms 49.02 MiB 49.31 MiB +288.50 KiB
CLI about:blank 13.71 ms 13.34 ms −0.37 ms 2.07 MiB 2.63 MiB +578.50 KiB
CLI local JS 16.57 ms 16.15 ms −0.42 ms 3.87 MiB 4.04 MiB +179.50 KiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 15.50 ms 15.69 ms +0.19 ms 824.00 KiB 748.00 KiB −76.00 KiB 0 0/0
5 19.40 ms 19.58 ms +0.17 ms 26.55 MiB 11.47 MiB −15.08 MiB 0 0/0
10 18.95 ms 19.30 ms +0.35 ms 22.17 MiB 25.97 MiB +3.80 MiB 0 0/0
25 19.12 ms 20.82 ms +1.69 ms 12.61 MiB 20.83 MiB +8.22 MiB 0 0/0
100 20.72 ms 19.05 ms −1.67 ms 22.53 MiB 16.81 MiB −5.72 MiB 0 0/0
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
1,020 0 0 0 0 0 0 6m 29.09s
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Fast contract Episodes Passed Assertions Ready p50 Episode p50
Moli 8 8 47/47 4.29 ms 25.06 ms
Chromium 8 8 47/47 303.62 ms 81.14 ms
Operation p50 Chromium Moli Delta Delta %
navigate 41.34 ms 6.94 ms −34.40 ms −83.21%
observe 1.39 ms 0.89 ms −0.50 ms −36.13%
fill 2.74 ms 3.03 ms +0.29 ms +10.65%
click 4.35 ms 3.62 ms −0.72 ms −16.65%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 64.18 MiB 61.48 MiB 0.66% 8.01% 1 ✅
Chromium 1254.81 MiB 319.41 MiB 1.88% 51.21% 13 ⚠️ PSS partial
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
Suite Cases Failures Median case p50 Median case p95 Median peak PSS p50
Synthetic fetch 13 0 17.39 ms 17.76 ms 585.00 KiB
Long-lived CDP session 13 0 19.50 ms 20.06 ms —
CDP smoke — ✅ 48/48 groups passed; 535 scenarios

Workers: 4 · cumulative group time: 152.71 s · failed groups: 0

Slowest group Scenarios Duration Status
target-lifecycle 24 17.24 s ✅
chromium-cdp 56 12.27 s ✅
multi-page 45 11.32 s ✅
dom-input 27 10.09 s ✅
layout-screenshot 5 7.54 s ✅

All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Spider Bench A/B

✅ All benchmark browser service runs completed; results are informational.

Public HEAD: 184 / 240 rows; 38 / 48 sites produced rows; 10 unexpected empty sites.

✅ Deterministic fixture contract is clean.

Common ancestor ef06d30495d9 → HEAD faf55d0966ab; benchmark order: base-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 184 / 240 184 / 240 0 (0.00%)
Contract fill 76.67% 76.67% 0.00 pp (0.00%)
Sites with rows 38 / 48 38 / 48 0 (0.00%)
Sites meeting row contract 36 / 48 36 / 48 0 (0.00%)
Unexpected empty sites 10 10 0 (0.00%)
Partial-row sites 2 2 0 (0.00%)
Site outcomes extracted: 36; HTTP error + rows: 2; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 extracted: 37; HTTP error + rows: 1; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 53.93 s 55.20 s +1.27 s (+2.35%)
Estimated CPU 51.48 s 48.58 s -2.90 s (-5.63%)
Peak PSS 273.50 MiB 257.00 MiB -16.50 MiB (-6.03%)
Peak RSS 275.03 MiB 260.52 MiB -14.50 MiB (-5.27%)
Peak threads 27 26 -1 (-3.70%)
Mismatched sites 0 0 0
Timeout with items 0 0 0
Category rows Base HEAD Δ
news 35 / 40 35 / 40 0
stocks 20 / 40 20 / 40 0
tech 35 / 40 35 / 40 0
sports 27 / 40 27 / 40 0
games 37 / 40 37 / 40 0
life 30 / 40 30 / 40 0

Public-site content, timing, and memory are noisy. This single A/B run reports evidence only; site outcome counts explain missing rows without treating them as a deterministic regression.

CPU and memory timelines

These are bounded 40-point views of the same complete process-tree samples used by the HTML report. CPU uses 100% per occupied logical core; memory lines are RSS first and PSS second when complete PSS samples are available.

Base

xychart-beta
    title "Base CPU"
    x-axis "Elapsed seconds" [1.536, 3.037, 4.541, 6.043, 7.543, 9.043, 10.544, 12.045, 13.548, 15.05, 16.552, 18.053, 19.555, 21.058, 22.559, 24.061, 25.562, 27.062, 28.065, 28.565, 30.067, 30.568, 31.569, 33.072, 34.575, 36.078, 37.581, 39.083, 40.583, 42.085, 43.587, 44.088, 45.089, 46.591, 48.094, 49.596, 51.096, 52.598]
    y-axis "CPU percent" 0 --> 500
    line [127.62, 141.84, 119.76, 179.71, 161.98, 56.01, 175.9, 111.96, 85.82, 125.98, 2, 6, 115.73, 5.99, 44, 113.92, 127.94, 131.99, 109.82, 131.76, 101.87, 193.73, 123.74, 103.85, 143.64, 39.92, 99.77, 7.98, 86.11, 97.89, 15.98, 0, 11.99, 93.98, 145.77, 15.96, 99.97, 115.97]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.536, 3.037, 4.541, 6.043, 7.543, 9.043, 10.544, 12.045, 13.548, 15.05, 16.552, 18.053, 19.555, 21.058, 22.559, 24.061, 25.562, 27.062, 28.065, 28.565, 30.067, 30.568, 31.569, 33.072, 34.575, 36.078, 37.581, 39.083, 40.583, 42.085, 43.587, 44.088, 45.089, 46.591, 48.094, 49.596, 51.096, 52.598, 53.93]
    y-axis "Memory MiB" 0 --> 500
    line [12.34, 100.06, 130.36, 149.89, 146.3, 155.17, 150.66, 155.23, 153.66, 177.94, 178.99, 164.46, 143.17, 162.26, 153.59, 146.02, 180.95, 156.99, 190.27, 275.03, 187.97, 203.74, 173.61, 164.99, 175.79, 165.87, 139.66, 141.65, 143.23, 161.72, 183.03, 161.6, 161.46, 153.93, 181.57, 155.28, 154.54, 155.84, 166.63, 0]
    line [9.25, 96.8, 126.98, 146.38, 142.9, 151.73, 147.31, 151.78, 150.2, 174.45, 174.69, 161, 139.72, 158.8, 150.1, 142.54, 177.46, 153.5, 186.8, 273.5, 184.38, 200.25, 168.83, 161.5, 172.33, 162.38, 136.17, 138.16, 139.75, 158.33, 179.54, 158.11, 157.97, 150.43, 178.09, 151.39, 151.05, 152.35, 163.18, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.536, 3.038, 4.54, 6.041, 7.542, 9.545, 11.046, 12.548, 14.049, 15.552, 17.054, 18.056, 18.556, 20.058, 21.56, 23.06, 24.562, 26.062, 28.065, 29.567, 30.567, 31.068, 32.57, 34.072, 35.573, 37.075, 38.576, 40.078, 41.579, 43.082, 44.583, 46.585, 48.086, 49.588, 51.089, 52.592, 54.093, 54.594]
    y-axis "CPU percent" 0 --> 500
    line [117.68, 137.76, 125.76, 135.88, 153.88, 175.59, 63.93, 125.91, 97.97, 4, 5.98, 0, 3.99, 0, 3.99, 6, 39.97, 53.99, 87.98, 131.93, 99.93, 109.95, 103.97, 139.74, 151.78, 133.81, 21.99, 71.96, 49.96, 85.76, 103.88, 2, 117.84, 135.84, 69.95, 105.89, 117.87, 197.8]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.536, 3.038, 4.54, 6.041, 7.542, 9.545, 11.046, 12.548, 14.049, 15.552, 17.054, 18.056, 18.556, 20.058, 21.56, 23.06, 24.562, 26.062, 28.065, 29.567, 30.567, 31.068, 32.57, 34.072, 35.573, 37.075, 38.576, 40.078, 41.579, 43.082, 44.583, 46.585, 48.086, 49.588, 51.089, 52.592, 54.093, 54.594, 55.198]
    y-axis "Memory MiB" 0 --> 500
    line [12.38, 108.25, 124.93, 150.07, 192.19, 169.43, 167.67, 163.16, 171.92, 171.77, 142.26, 145.71, 145.36, 144.23, 144.47, 145.2, 147.23, 151.86, 154.86, 153.2, 161.91, 260.52, 240.21, 208.15, 165.67, 162.98, 167.7, 144.37, 144.96, 147.68, 159.76, 181.86, 152.53, 167.34, 164.19, 155.73, 147.59, 172.71, 192.88, 0]
    line [9.23, 104.85, 121.5, 146.61, 188.75, 165.93, 164.16, 159.75, 168.43, 168.25, 138.75, 142.2, 141.85, 140.72, 140.96, 141.69, 143.75, 148.35, 152.23, 150.01, 158.38, 257, 236.17, 204.65, 162.15, 159.47, 164.18, 140.85, 141.49, 144.15, 156.33, 177.61, 149, 163.81, 160.69, 152.21, 144.07, 169.21, 189.45, 0]
Loading

Deterministic fixture · required contract

The fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 40 / 40 40 / 40 0 (0.00%)
Contract fill 100.00% 100.00% 0.00 pp (0.00%)
Sites with rows 8 / 15 8 / 15 0 (0.00%)
Sites meeting row contract 15 / 15 15 / 15 0 (0.00%)
Unexpected empty sites 0 0 0
Partial-row sites 0 0 0
Site outcomes extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 —
Observed duration 19.88 s 19.88 s -0.01 s (-0.03%)
Estimated CPU 0.41 s 0.39 s -0.02 s (-4.38%)
Peak PSS 57.69 MiB 57.88 MiB +0.19 MiB (+0.33%)
Peak RSS 61.13 MiB 61.29 MiB +0.16 MiB (+0.26%)
Peak threads 18 18 0 (0.00%)
Mismatched sites 0 0 0
Timeout with items 0 0 0

Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full spider-bench-results artifact.

The public-web A/B is informational. The exact HEAD fixture contract runs as a separate required CI check; timing and public-site content deltas remain non-blocking.

@ldm0

ldm0 commented Sep 23, 2026

Copy link
Copy Markdown
Member

This PR was rebased on main and merged in #775

@ldm0 ldm0 closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants