Page MenuHomePhabricator

Fix a flash of document selection when "oncopy" and "inline on range" behaviors interact
ClosedPublic

Authored by epriestley on May 14 2020, 6:40 PM.
Tags
None
Referenced Files
F19644352: D21254.diff
Thu, Feb 5, 10:11 PM
F19644346: D21254.diff
Thu, Feb 5, 10:11 PM
F19565619: D21254.diff
Jan 31 2026, 6:19 PM
F19565465: D21254.diff
Jan 31 2026, 6:14 PM
F19554451: D21254.diff
Jan 29 2026, 10:23 PM
F19521932: D21254.diff
Jan 17 2026, 3:03 AM
F19519208: D21254.diff
Jan 16 2026, 3:02 AM
F19516707: D21254.diff
Jan 15 2026, 3:02 AM
Subscribers
None

Details

Summary

Ref T13513. In Safari, do this:

  • view a 2-up diff with content on both sides;
  • select more than one line on the right side; and
  • use your mouse to click "New Inline Comment" in the context menu that pops up.

The mousedown event for the "New Inline Comment" click removes the "copy selection" behavior and creates a flash where both sides of the diff are selected.

This doesn't happen with (most) normal clicks because mouse down on a non-grabbable element clears the document selection.

To avoid this, don't reset the copy selection behavior if the user mouses down on an "<a />". This might not be robust, but seems simple and plausible as a fix.

Test Plan
  • See above.
  • Before patch: flash of overbroad selection when clicking "New Inline Comment".
  • After patch: no selection flash.

Diff Detail

Repository
rP Phabricator
Branch
inline3
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24427
Build 33659: Run Core Tests
Build 33658: arc lint + arc unit