Changeset 256550 in webkit
- Timestamp:
- Feb 13, 2020 2:52:36 PM (4 years ago)
- Location:
- branches/safari-609.1.17.0-branch/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-609.1.17.0-branch/Source/WebKit/ChangeLog
r256549 r256550 1 2020-02-13 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r255879. rdar://problem/59299329 4 5 [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia 6 https://bugs.webkit.org/show_bug.cgi?id=207299 7 <rdar://problem/59200545> 8 9 Reviewed by Tim Horton. 10 11 After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will 12 always attempt to show a caret at that location, whose height is the height of the editing caret for that 13 visible position. However, this means that: 14 15 - It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as 16 a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret 17 height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on 18 en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since 19 the caret would temporarily hover over an editing position that is before a large table. 20 21 - This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it 22 so that in the case where the cursor is in editable content and the line caret first line from the top of 23 the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be 24 right over the request point. 25 26 * WebProcess/WebPage/ios/WebPageIOS.mm: 27 (WebKit::populateCaretContext): 28 29 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255879 268f45cc-cd09-0410-ab3c-d52691b4dbfc 30 31 2020-02-05 Wenson Hsieh <wenson_hsieh@apple.com> 32 33 [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia 34 https://bugs.webkit.org/show_bug.cgi?id=207299 35 <rdar://problem/59200545> 36 37 Reviewed by Tim Horton. 38 39 After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will 40 always attempt to show a caret at that location, whose height is the height of the editing caret for that 41 visible position. However, this means that: 42 43 - It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as 44 a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret 45 height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on 46 en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since 47 the caret would temporarily hover over an editing position that is before a large table. 48 49 - This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it 50 so that in the case where the cursor is in editable content and the line caret first line from the top of 51 the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be 52 right over the request point. 53 54 * WebProcess/WebPage/ios/WebPageIOS.mm: 55 (WebKit::populateCaretContext): 56 1 57 2020-02-13 Russell Epstein <repstein@apple.com> 2 58 -
branches/safari-609.1.17.0-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r256549 r256550 2796 2796 return; 2797 2797 2798 auto* renderer = hitTestResult.innerNode()->renderer(); 2798 auto node = hitTestResult.innerNode(); 2799 if (!node) 2800 return; 2801 2802 auto* renderer = node->renderer(); 2799 2803 if (!renderer) 2800 2804 return; … … 2823 2827 if (!lineContainsRequestPoint && info.cursor->type() == Cursor::IBeam) { 2824 2828 auto approximateLineRectInContentCoordinates = renderer->absoluteBoundingBoxRect(); 2825 approximateLineRectInContentCoordinates.setHeight( position.absoluteCaretBounds().height());2829 approximateLineRectInContentCoordinates.setHeight(renderer->style().computedLineHeight()); 2826 2830 info.lineCaretExtent = view->contentsToRootView(approximateLineRectInContentCoordinates); 2827 info.lineCaretExtent.setY(request.point.y() - info.lineCaretExtent.height() / 2); 2831 if (!info.lineCaretExtent.contains(request.point) || !node->hasEditableStyle()) 2832 info.lineCaretExtent.setY(request.point.y() - info.lineCaretExtent.height() / 2); 2828 2833 info.caretHeight = info.lineCaretExtent.height(); 2829 2834 }
Note: See TracChangeset
for help on using the changeset viewer.