-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use alternative approach to shadow-selection-polyfill
Since the selection shadow DOM is not implemented in Safari, a fix was introduced in January 2021[1] to use the shadow-selection-polyfill library to provide that functionality and allow selecting text to comment. As of March 2021 however, an fix to Safari[2] makes the shadow-selection-polyfill not working from Safari v14.1 onwards. It is not clear whether the library will ever work again in Safari, so much so that a warning, explaining this, as been added to the shadow-selection-polyfill README.md. An alternative approach however has been suggested. The main idea is: * Listen to 'selectionchange' events of 'contenteditable' areas. * Trigger a 'beforeinput' event by running and immediately terminating an `execCommand`. * use the getTargetRanges() method to get a list of static ranges This change is the porting of that idea (as explained here[4]). [1] https://gerrit-review.googlesource.com/c/gerrit/+/293242 [2] https://trac.webkit.org/changeset?reponame=webkit&new=269662 [3] https://github.com/GoogleChromeLabs/shadow-selection-polyfill [4] GoogleChromeLabs/shadow-selection-polyfill#11 Bug: Issue 13955 Change-Id: I4daebbfd571dc3f11c2897a2282d6b6b3619a2c0
- Loading branch information
Showing
9 changed files
with
169 additions
and
449 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.