Repository navigation
fix(window): stop WebKit dropping clicks on controls the page repaints mid-press - #500
Merged
Merged
Conversation
…ck held across a repaint
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…ble across a repaint paint() still rewrote three control texts on every tick, so a press held on the title lost its rename click in WebKit the same way Back to live did. Route them through label() and extend DK-W1 to hold a press on the title and check every relabelled control keeps its text node.
# Conflicts: # docs/TRAPS.md
# Conflicts: # docs/TRAPS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In WebKit, clicking "Back to live" sometimes did nothing. The page rewrites the button's text on every paint, which happens once a second and on every new line, even when the words stay the same. WebKit remembers the text node a press landed on, and if that node is gone by the release it sends no click. So any press held across a repaint was lost. A tenth-of-a-second press spans the one-second paint about one time in ten. Stop has the same problem. Chromium sends the click anyway, so only CI's WebKit leg caught it: the W4.1 parity test timed out with "waiting for pinned after Back to live while lines arrive" (run 41157257991 on main).
The fix adds a
label()helper in src/ui/dom.ts that writes a control's text only when the words changed. Every control the window's paint and the share viewer relabel now goes through it: Back to live in the window and in the share viewer, the title (a click renames the call), the words-to-review pill, the Record key, Stop, Mute, Pause, and the banner's action button.How the cause was pinned:
mousedownandmouseupon#jump, noclick, and a new line rendered between the two.button.textContent = "Back"on a timer: WebKit lost 15 of 150 clicks and Chromium lost 0 of 150. Updating the existing text node'sdatalost none. WebKit'sEventHandler::nodeWillBeRemovedclears the remembered click node when that node is removed.Before and after, W4.1 in CI's WebKit:
Regression test:
[DK-W1]in tests/ui/parity.test.ts holds a press on Back to live, then a second one on the title, each across a new line and the one-second paint. It checks that Back to live, the title, the review pill, Stop, Mute, Pause and the banner action all kept their text node, that the first release goes back to live, and that the second opens the rename box. On macOS it passed 10 of 10 runs per engine. The first version (Back to live only) passed 720 of 720 WebKit runs on CI.Positive control: writing
textContentunconditionally fails it in WebKit and in Chromium, for Back to live, the title and the review pill alike, and the failure names the control that lost its node. With the old title line, WebKit also drops the rename click itself. The test can't see the Record key, because the test rig registers no global hotkey and the label stays empty there. That one goes throughlabel()too, but no test covers it.The trap is written down as DK-W1 in docs/TRAPS.md. The temporary workflow is deleted.
The branch has temporary diagnostic commits, so please squash-merge it.