Changeset 245238 in webkit
- Timestamp:
- May 13, 2019, 9:52:05 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/selection/preserve-selection-when-clicking-button-expected.txt (added)
-
LayoutTests/editing/selection/preserve-selection-when-clicking-button.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FocusController.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245235 r245238 1 2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] Font formatting options don't work when composing a message in Yahoo mail 4 https://bugs.webkit.org/show_bug.cgi?id=197813 5 <rdar://problem/49382250> 6 7 Reviewed by Darin Adler. 8 9 Add a new layout test to verify that DOM selection is preserved after clicking a button that hides itself 10 upon mousedown. 11 12 * editing/selection/preserve-selection-when-clicking-button-expected.txt: Added. 13 * editing/selection/preserve-selection-when-clicking-button.html: Added. 14 1 15 2019-05-13 Sihui Liu <sihui_liu@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r245236 r245238 1 2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] Font formatting options don't work when composing a message in Yahoo mail 4 https://bugs.webkit.org/show_bug.cgi?id=197813 5 <rdar://problem/49382250> 6 7 Reviewed by Darin Adler. 8 9 The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the 10 font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement. 11 12 There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due 13 to the mousePressNode not being able to start a selection. However, since the clickable element in this case is 14 hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() && 15 !mousePressNode->canStartSelection()` check as a result. 16 17 This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking 18 a button; the intention appears to have been making it so that clicking on something that could not start a 19 selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to 20 this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so 21 it seems safe to remove this requirement. 22 23 Test: editing/selection/preserve-selection-when-clicking-button.html 24 25 * page/FocusController.cpp: 26 (WebCore::clearSelectionIfNeeded): 27 1 28 2019-05-13 Eric Carlson <eric.carlson@apple.com> 2 29 -
trunk/Source/WebCore/page/FocusController.cpp
r241932 r245238 775 775 776 776 if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode()) { 777 if ( mousePressNode->renderer() &&!mousePressNode->canStartSelection()) {777 if (!mousePressNode->canStartSelection()) { 778 778 // Don't clear the selection for contentEditable elements, but do clear it for input and textarea. See bug 38696. 779 779 auto* root = selection.rootEditableElement();
Note:
See TracChangeset
for help on using the changeset viewer.