mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 16:39:22 +08:00
Three layers, each covering what the others cannot. The node tests pin the arithmetic directly: the fit width formula is unchanged from before the feature, 100% is the page's real size rather than its `scale: 1` size, the canvas budget clamps per page and not only for page one, a step walks past the stops the budget has flattened, and a wheel notch changes the page even when the stored request is already at the ceiling — multiplying the request instead of the landed width left the first notches of a zoom-out doing nothing. The shortcut cases cover the gap the old signature hid: it had no field for "the event is going into a field", so no test could describe the case. Both readers' matchers are checked with `editableTarget: true` for every combination they bind. The jsdom specs drive the component: stepping from the ratio actually on screen, holding the page still when the pane resizes in fixed mode, keeping the pointer's line and column in place through ctrl+wheel, the bitmap budget per page, the menu lifecycle, a row printing the size it will actually produce, and the percentage being announced. The browser audit is the one that found something. jsdom has no layout and no real tab order, so it cannot answer whether the hidden bar is reachable, whether `focus-within` actually reveals it, or which of two `window` Escape listeners wins. It steps the page size, tabs into the hidden bar, walks the real tab order until focus reaches the bar, drives the menu from the keyboard, closes it with Escape without leaving the reading mode, and requires a step at the ceiling either to change the width or to disable its control. That audit caught a defect the jsdom test could not: the arrow-key handler was attached to the menu element, but when the menu opens focus is still on the trigger — a sibling of the menu — so the keydown never reached the handler and the menu could not be driven from the keyboard at all. The unit test passed because it dispatched the key on the menu node directly, bypassing the real event path. Both keyboard cases are verified by reverting the code they cover.