Changeset 245306 in webkit
- Timestamp:
- May 14, 2019, 2:07:45 PM (7 years ago)
- Location:
- branches/safari-608.1.24-branch
- 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
-
branches/safari-608.1.24-branch/LayoutTests/ChangeLog
r245230 r245306 1 2019-05-14 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r245238. rdar://problem/49382250 4 5 [macOS] Font formatting options don't work when composing a message in Yahoo mail 6 https://bugs.webkit.org/show_bug.cgi?id=197813 7 <rdar://problem/49382250> 8 9 Reviewed by Darin Adler. 10 11 Source/WebCore: 12 13 The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the 14 font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement. 15 16 There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due 17 to the mousePressNode not being able to start a selection. However, since the clickable element in this case is 18 hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() && 19 !mousePressNode->canStartSelection()` check as a result. 20 21 This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking 22 a button; the intention appears to have been making it so that clicking on something that could not start a 23 selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to 24 this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so 25 it seems safe to remove this requirement. 26 27 Test: editing/selection/preserve-selection-when-clicking-button.html 28 29 * page/FocusController.cpp: 30 (WebCore::clearSelectionIfNeeded): 31 32 LayoutTests: 33 34 Add a new layout test to verify that DOM selection is preserved after clicking a button that hides itself 35 upon mousedown. 36 37 * editing/selection/preserve-selection-when-clicking-button-expected.txt: Added. 38 * editing/selection/preserve-selection-when-clicking-button.html: Added. 39 40 41 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245238 268f45cc-cd09-0410-ab3c-d52691b4dbfc 42 43 2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com> 44 45 [macOS] Font formatting options don't work when composing a message in Yahoo mail 46 https://bugs.webkit.org/show_bug.cgi?id=197813 47 <rdar://problem/49382250> 48 49 Reviewed by Darin Adler. 50 51 Add a new layout test to verify that DOM selection is preserved after clicking a button that hides itself 52 upon mousedown. 53 54 * editing/selection/preserve-selection-when-clicking-button-expected.txt: Added. 55 * editing/selection/preserve-selection-when-clicking-button.html: Added. 56 1 57 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 58 -
branches/safari-608.1.24-branch/Source/WebCore/ChangeLog
r245232 r245306 1 2019-05-14 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r245238. rdar://problem/49382250 4 5 [macOS] Font formatting options don't work when composing a message in Yahoo mail 6 https://bugs.webkit.org/show_bug.cgi?id=197813 7 <rdar://problem/49382250> 8 9 Reviewed by Darin Adler. 10 11 Source/WebCore: 12 13 The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the 14 font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement. 15 16 There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due 17 to the mousePressNode not being able to start a selection. However, since the clickable element in this case is 18 hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() && 19 !mousePressNode->canStartSelection()` check as a result. 20 21 This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking 22 a button; the intention appears to have been making it so that clicking on something that could not start a 23 selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to 24 this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so 25 it seems safe to remove this requirement. 26 27 Test: editing/selection/preserve-selection-when-clicking-button.html 28 29 * page/FocusController.cpp: 30 (WebCore::clearSelectionIfNeeded): 31 32 LayoutTests: 33 34 Add a new layout test to verify that DOM selection is preserved after clicking a button that hides itself 35 upon mousedown. 36 37 * editing/selection/preserve-selection-when-clicking-button-expected.txt: Added. 38 * editing/selection/preserve-selection-when-clicking-button.html: Added. 39 40 41 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245238 268f45cc-cd09-0410-ab3c-d52691b4dbfc 42 43 2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com> 44 45 [macOS] Font formatting options don't work when composing a message in Yahoo mail 46 https://bugs.webkit.org/show_bug.cgi?id=197813 47 <rdar://problem/49382250> 48 49 Reviewed by Darin Adler. 50 51 The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the 52 font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement. 53 54 There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due 55 to the mousePressNode not being able to start a selection. However, since the clickable element in this case is 56 hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() && 57 !mousePressNode->canStartSelection()` check as a result. 58 59 This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking 60 a button; the intention appears to have been making it so that clicking on something that could not start a 61 selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to 62 this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so 63 it seems safe to remove this requirement. 64 65 Test: editing/selection/preserve-selection-when-clicking-button.html 66 67 * page/FocusController.cpp: 68 (WebCore::clearSelectionIfNeeded): 69 1 70 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 71 -
branches/safari-608.1.24-branch/Source/WebCore/page/FocusController.cpp
r241932 r245306 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.