Created attachment 55315 [details] Test If I have some selected text and then do a mousedown on an element that has user-select none the current selection should not be cleared. The code to fix this is in Node::canStartSelection. if (style->userDrag() == DRAG_ELEMENT && style->userSelect() == SELECT_NONE) should be changed to if (style->userDrag() == DRAG_ELEMENT || style->userSelect() == SELECT_NONE) The following two LayoutTests needs to be updated as well: editing/selection/5333725.html editing/selection/user-drag-element-and-user-select-none.html
Does this need #if ENABLE(DRAG_SUPPORT) flags as well? It will probably work fine without with the proposed change but all other uses of userDrag() have the define wrapped around it somewhere.
Created attachment 419682 [details] An extra HTML file with a similar (possibly the same) issue The same issue, but specifically where the first selection is in a content editable element, is affecting my product. I'm using Safari 14.0.2 on MacOS 11.1, so it looks like this bug (or some variant of it) is still happening.
Based on the "Test" attachment, the original bug looks fixed: clicking on `-webkit-user-select: none` doesn't destroy text selection. But like Neil said, it _does_ destroy selection if the selection is in [contentEditable]. This makes it really difficult to support Safari if you have a WYSIWYG editor and have div-based controls that operate on the selection. You want the selection to stay the same while the user formats it. Oddly the native <button> passes the test cases in both attachments.