Page MenuHomePhabricator

Simplify oncopy behavior
ClosedPublic

Authored by sophiebits on Apr 3 2014, 8:24 AM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

sophiebits updated this revision to Diff 20600.Apr 3 2014, 8:24 AM
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.
Herald added subscribers: Korvin, epriestley.
epriestley accepted this revision.Apr 3 2014, 4:20 PM
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 closed this revision.Apr 3 2014, 4:21 PM
epriestley updated this revision to Diff 20605.

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