Page MenuHomePhabricator

Simplify oncopy behavior
ClosedPublic

Authored by sophiebits on Apr 3 2014, 8:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 10:31 AM
Unknown Object (File)
Wed, Apr 10, 8:27 AM
Unknown Object (File)
Wed, Apr 10, 7:37 AM
Unknown Object (File)
Tue, Apr 2, 10:11 AM
Unknown Object (File)
Sat, Mar 30, 11:29 AM
Unknown Object (File)
Fri, Mar 29, 10:45 AM
Unknown Object (File)
Feb 4 2024, 7:19 PM
Unknown Object (File)
Feb 4 2024, 7:18 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP26c836e1e14e: Simplify oncopy behavior
Summary

Firefox has supported clipboardData since version 22 (Jul 2013), and even IE8 supports it if you look at window.clipboardData instead of e.clipboardData. As a result, we can simplify this code significantly.

I also used (or at least, attempted to) Javelin so that we can get the event object and preventDefault more easily. Plus, this way we don't assign to document.body.oncopy.

Test Plan

Copied a selection including a line number in Chrome, Firefox, and IE8. The line number didn't get copied.

Diff Detail

Repository
rP Phabricator
Branch
simplify-oncopy
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

sophiebits retitled this revision from to Simplify oncopy behavior.
sophiebits updated this object.
sophiebits edited the test plan for this revision. (Show Details)
sophiebits added a reviewer: epriestley.
epriestley edited edge metadata.

July 2013 is kind of recent (see D835) but if anyone complains we can revert this and then apply it in a year or two.

This revision is now accepted and ready to land.Apr 3 2014, 4:20 PM
epriestley updated this revision to Diff 20605.

Closed by commit rP26c836e1e14e (authored by @spicyj, committed by @epriestley).