Changeset 265174 in webkit
- Timestamp:
- Aug 1, 2020 1:02:05 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r265171 r265174 1 2020-08-01 Megan Gardner <megan_gardner@apple.com> 2 3 Unable to select multiple lines of vertical text correctly 4 https://bugs.webkit.org/show_bug.cgi?id=213671 5 <rdar://problem/53753636> 6 7 Reviewed by Darin Adler. 8 9 In order to make for a better text selection experience, we pulled the selection position 10 down to be on the last line selectable, rather than snap the selection to a single position. 11 This made for a better selection experience on small text, but we failed to take 12 vertical text into account, and a user is locked into only selecting vertical text that ends below the 13 other anchor point of the selection. We should have the same behavior for vertical text, but correctly 14 calculated for X instead of Y. 15 This does not fix all cases, but it fixes the most glaring cases. 16 17 * WebProcess/WebPage/ios/WebPageIOS.mm: 18 (WebKit::rangeForPointInRootViewCoordinates): 19 1 20 2020-07-31 Jer Noble <jer.noble@apple.com> 2 21 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r265084 r265174 108 108 #import <WebCore/Node.h> 109 109 #import <WebCore/NodeList.h> 110 #import <WebCore/NodeRenderStyle.h> 110 111 #import <WebCore/NotImplemented.h> 111 112 #import <WebCore/Page.h> … … 1494 1495 auto pointInDocument = frame.view()->rootViewToContents(pointInRootViewCoordinates); 1495 1496 1496 if (baseIsStart) { 1497 int startY = selectionStart.absoluteCaretBounds().center().y(); 1498 if (pointInDocument.y() < startY) 1499 pointInDocument.setY(startY); 1497 auto node = selectionStart.deepEquivalent().containerNode(); 1498 if (node && node->renderStyle() && node->renderStyle()->isVerticalWritingMode()) { 1499 if (baseIsStart) { 1500 int startX = selectionStart.absoluteCaretBounds().center().x(); 1501 if (pointInDocument.x() > startX) 1502 pointInDocument.setX(startX); 1503 } else { 1504 int endX = selectionEnd.absoluteCaretBounds().center().x(); 1505 if (pointInDocument.x() < endX) 1506 pointInDocument.setX(endX); 1507 } 1500 1508 } else { 1501 int endY = selectionEnd.absoluteCaretBounds().center().y(); 1502 if (pointInDocument.y() > endY) 1503 pointInDocument.setY(endY); 1509 if (baseIsStart) { 1510 int startY = selectionStart.absoluteCaretBounds().center().y(); 1511 if (pointInDocument.y() < startY) 1512 pointInDocument.setY(startY); 1513 } else { 1514 int endY = selectionEnd.absoluteCaretBounds().center().y(); 1515 if (pointInDocument.y() > endY) 1516 pointInDocument.setY(endY); 1517 } 1504 1518 } 1505 1519
Note: See TracChangeset
for help on using the changeset viewer.