Summary: | user-select: none shouldn't affect editability | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||||
Component: | HTML Editing | Assignee: | Tim Nguyen (:ntim) <ntim> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | changseok, clopez, darin, enrica, esprehn+autocc, ews-watchlist, ferdy.christant, glenn, koivisto, kondapallykalyan, megan_gardner, ntim, pdr, webkit-bug-importer, wenson_hsieh, youennf | ||||||||
Priority: | P2 | Keywords: | BlinkMergeCandidate, InRadar | ||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://github.com/web-platform-tests/wpt/pull/33694 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 208677 | ||||||||||
Attachments: |
|
Description
Ryosuke Niwa
2013-06-25 19:24:49 PDT
This code.... *, *:before, *:after { user-select: none; } Is sometimes used by people to avoid text selection alltogether, mostly in a PWA or Add to Homescreen scenario. The above code completely blocks keyboard input on input fields. This is only an issue on mobile Safari, as far as I was able to test. Is this 2013 bug I'm commenting on the same scope? Any plans to pick it up? (In reply to Ferdy Christant from comment #1) > This code.... > > *, *:before, *:after { > user-select: none; > } > > Is sometimes used by people to avoid text selection alltogether, mostly in a > PWA or Add to Homescreen scenario. > > The above code completely blocks keyboard input on input fields. This is > only an issue on mobile Safari, as far as I was able to test. > > Is this 2013 bug I'm commenting on the same scope? Any plans to pick it up? This is indeed the bug that tracks this issue. It's a bad idea to have such a style on the entire page since it would prevent users from selecting any text even if fixing this bug was a good idea. Agreed on both accounts: that this is a bad practice, and that regardless of the practice, it's still a bug. There's effectiveUserSelect() that can be changed to take in account user-modify. Created attachment 457879 [details]
Patch
*** Bug 82692 has been marked as a duplicate of this bug. *** Comment on attachment 457879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457879&action=review > Source/WebCore/rendering/style/RenderStyle.h:630 > + UserSelect effectiveUserSelect() const { return effectiveInert() ? UserSelect::None : (userModify() == UserModify::ReadOnly ? userSelect() : UserSelect::Text); } Maybe just move this out-of-line and make it multiline with ifs? Nested ternary operators are difficult to read. > LayoutTests/ChangeLog:9 > + - Added new tests for new behavior (imported from the Blink codebase) Is a WPT possible? Created attachment 457900 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/33694 Created attachment 457910 [details]
Patch
Committed r293028 (249767@main): <https://commits.webkit.org/249767@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457910 [details]. |