Changeset 276688 in webkit
- Timestamp:
- Apr 27, 2021, 7:54:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/selection/ios/clear-selection-while-moving-selection-handles-expected.txt (added)
-
LayoutTests/editing/selection/ios/clear-selection-while-moving-selection-handles.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Position.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276687 r276688 1 2021-04-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Web content process occasionally crashes under VisibleSelection::adjustPositionForEnd 4 https://bugs.webkit.org/show_bug.cgi?id=225072 5 rdar://77159489 6 7 Reviewed by Darin Adler. 8 9 Add a layout test that programmatically clears the selection in the middle of changing it by moving selection 10 handles. 11 12 * editing/selection/ios/clear-selection-while-moving-selection-handles-expected.txt: Added. 13 * editing/selection/ios/clear-selection-while-moving-selection-handles.html: Added. 14 1 15 2021-04-27 Diego Pino Garcia <dpino@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r276679 r276688 1 2021-04-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Web content process occasionally crashes under VisibleSelection::adjustPositionForEnd 4 https://bugs.webkit.org/show_bug.cgi?id=225072 5 rdar://77159489 6 7 Reviewed by Darin Adler. 8 9 Add a helper method to check whether or not the given `Position` is in a tree scope. See WebKit/ChangeLog for 10 more details. 11 12 Test: editing/selection/ios/clear-selection-while-moving-selection-handles.html 13 14 * dom/Position.h: 15 (WebCore::Position::isInTreeScope const): 16 1 17 2021-04-27 Cameron McCormack <heycam@apple.com> 2 18 -
trunk/Source/WebCore/dom/Position.h
r276191 r276688 125 125 } 126 126 127 bool isInTreeScope() const { return m_anchorNode && m_anchorNode->isInTreeScope(); } 128 127 129 // These should only be used for PositionIsOffsetInAnchor positions, unless 128 130 // the position is a legacy editing position. -
trunk/Source/WebKit/ChangeLog
r276678 r276688 1 2021-04-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Web content process occasionally crashes under VisibleSelection::adjustPositionForEnd 4 https://bugs.webkit.org/show_bug.cgi?id=225072 5 rdar://77159489 6 7 Reviewed by Darin Adler. 8 9 Make `rangeForPointInRootViewCoordinates` robust in the case where the original selection may have become 10 orphaned or null, by checking that the `targetNode` and existing `selectionStart` or `selectionEnd` are in a 11 tree scope before accessing `treeScope()`. 12 13 * WebProcess/WebPage/ios/WebPageIOS.mm: 14 (WebKit::rangeForPointInRootViewCoordinates): 15 1 16 2021-04-27 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r276598 r276688 1525 1525 if (result <= selectionStart) 1526 1526 result = selectionStart.next(); 1527 else if (targetNode && selectionStart.deepEquivalent().treeScope() != &targetNode->treeScope())1527 else if (targetNode && targetNode->isInTreeScope() && selectionStart.deepEquivalent().isInTreeScope() && selectionStart.deepEquivalent().treeScope() != &targetNode->treeScope()) 1528 1528 result = VisibleSelection::adjustPositionForEnd(result.deepEquivalent(), selectionStart.deepEquivalent().containerNode()); 1529 1529 … … 1532 1532 if (selectionEnd <= result) 1533 1533 result = selectionEnd.previous(); 1534 else if (targetNode && selectionEnd.deepEquivalent().treeScope() != &targetNode->treeScope())1534 else if (targetNode && targetNode->isInTreeScope() && selectionEnd.deepEquivalent().isInTreeScope() && selectionEnd.deepEquivalent().treeScope() != &targetNode->treeScope()) 1535 1535 result = VisibleSelection::adjustPositionForStart(result.deepEquivalent(), selectionEnd.deepEquivalent().containerNode()); 1536 1536
Note:
See TracChangeset
for help on using the changeset viewer.