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