HomePhabricator
Diffusion Comm c9f0f74eb02b

[web] Prevent hidden spoiler content from being revealed by text/cursor…

Tags
None
Referenced Files
F232668: Text Highlighting After.mov
Nov 16 2022, 9:14 AM
File Not Attached
F232672: Text Highlighting Before.mov
Nov 16 2022, 9:14 AM
File Not Attached
Subscribers
None

Description

[web] Prevent hidden spoiler content from being revealed by text/cursor highlighting

Summary:
On web, when a user highlights text with their cursor, we want to prevent 1) the text from being displayed to reveal the spoiler and 2) being copied prior to being revealed.

Linear: https://linear.app/comm/issue/ENG-2227/prevent-hidden-spoiler-content-from-being-revealed-by-textcursor

References:
https://caniuse.com/user-select-none
https://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting

Depends on D5601

Test Plan:
Tested visually to make sure that the text doesn't reveal on highlight and also made sure the unrevealed spoiler content does not get copied.

Before:

After:

Reviewers: atul, ginsu

Reviewed By: atul, ginsu

Subscribers: ashoat, tomek, abosh

Differential Revision: https://phab.comm.dev/D5617

Details