Changeset 281054 in webkit
- Timestamp:
- Aug 13, 2021, 5:47:03 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/ios-14/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Platform/spi/ios/UIKitSPI.h (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (modified) (3 diffs)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (9 diffs)
-
Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r281038 r281054 1 2021-08-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS 15] fast/events/touch/ios/long-press-on-link.html is a constant crash 4 https://bugs.webkit.org/show_bug.cgi?id=229095 5 rdar://80386326 6 7 Reviewed by Tim Horton. 8 9 Remove the failing test expectation (and remove a passing expectation for iOS 14 which is no longer necessary 10 after this fix). 11 12 * platform/ios-14/TestExpectations: 13 * platform/ios/TestExpectations: 14 1 15 2021-08-13 Ayumi Kojima <ayumi_kojima@apple.com> 2 16 -
trunk/LayoutTests/platform/ios-14/TestExpectations
r280427 r281054 73 73 http/tests/websocket/tests/hybi/too-long-payload.html [ Pass ] 74 74 75 #rdar://80386326 ([ iOS15 Release ] fast/events/touch/ios/long-press-on-link.html is a constant crash)76 fast/events/touch/ios/long-press-on-link.html [ Pass ]77 78 75 # rdar://80392337 ([ iOS15 ] fast/text/international/system-language/navigator-language/navigator-language-ru.html is a constant failure) 79 76 fast/text/international/system-language/navigator-language/navigator-language-ru.html [ Pass ] -
trunk/LayoutTests/platform/ios/TestExpectations
r281010 r281054 3411 3411 http/tests/websocket/tests/hybi/too-long-payload.html [ Timeout ] 3412 3412 3413 #rdar://80386326 ([ iOS15 Release ] fast/events/touch/ios/long-press-on-link.html is a constant crash)3414 fast/events/touch/ios/long-press-on-link.html [ Crash ]3415 3416 3413 # rdar://80392337 ([ iOS15 ] fast/text/international/system-language/navigator-language/navigator-language-ru.html is a constant failure) 3417 3414 fast/text/international/system-language/navigator-language/navigator-language-ru.html [ Failure ] -
trunk/Source/WebKit/ChangeLog
r281044 r281054 1 2021-08-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS 15] fast/events/touch/ios/long-press-on-link.html is a constant crash 4 https://bugs.webkit.org/show_bug.cgi?id=229095 5 rdar://80386326 6 7 Reviewed by Tim Horton. 8 9 This test crashes when run immediately after another test that attempts to present the context menu and ends 10 with the context menu still showing (in this case, fast/events/touch/ios/long-press-on-image.html). Running 11 these tests back to back causes us to immediately dismiss the context menu interaction while transitioning to 12 the second test, which triggers the context menu interaction's dismissal animation. 13 14 This animation ends in the middle of the next test (long-press-on-link.html), after the long press has begun and 15 the context menu interaction has already requested a targeted hint preview, but (importantly) before the context 16 menu peek animation actually begins (i.e. `-contextMenuInteraction:willDisplayMenuForConfiguration:animator:`). 17 As a result, we tear down the hint container too early (with the hint view still in the view hierarchy), and 18 subsequently crash with an exception when UIKit tries to perform coordinate space conversions with the now- 19 unparented view. 20 21 To fix this, we make two small adjustments: 22 1. Avoid unparenting the context menu hint container if it still has subviews. 23 2. Add plumbing to ensure that the context menu hint container is unparented once all of its subviews have 24 been removed (and the container isn't being used for anything else). 25 26 * Platform/spi/ios/UIKitSPI.h: 27 28 Add an SPI declaration for the `-_didRemoveSubview:` subclassing hook. 29 30 * UIProcess/ios/WKContentViewInteraction.h: 31 * UIProcess/ios/WKContentViewInteraction.mm: 32 (-[WKTargetedPreviewContainer initWithContentView:]): 33 (-[WKTargetedPreviewContainer _didRemoveSubview:]): 34 35 Add a new subclass for WKTargetedPreviewContainer that notifies WKContentView when its last subview has been 36 removed, such that WKContentView can tear down the container view if needed. 37 38 (-[WKContentView cleanUpInteraction]): 39 (-[WKContentView removeContextMenuViewIfPossibleForActionSheetAssistant:]): 40 (-[WKContentView _targetedPreviewContainerDidRemoveLastSubview:]): 41 (-[WKContentView _createPreviewContainerWithLayerName:]): 42 (-[WKContentView _removeContextMenuHintContainerIfPossible]): 43 (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): 44 (-[WKContentView _removeContextMenuViewIfPossible]): Deleted. 45 46 Additionally rename `-_removeContextMenuViewIfPossible` to `-_removeContextMenuHintContainerIfPossible`, to make 47 it clear that this method is about removing the container view for context menu hints (and not the hints 48 themselves). 49 50 * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm: 51 (-[WKDataListSuggestionsDropdown _removeContextMenuInteraction]): 52 * UIProcess/ios/forms/WKDateTimeInputControl.mm: 53 (-[WKDateTimePicker removeContextMenuInteraction]): 54 * UIProcess/ios/forms/WKFileUploadPanel.mm: 55 (-[WKFileUploadPanel removeContextMenuInteraction]): 56 * UIProcess/ios/forms/WKFormSelectPicker.mm: 57 (-[WKSelectPicker removeContextMenuInteraction]): 58 1 59 2021-08-13 Jer Noble <jer.noble@apple.com> 2 60 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r280986 r281054 638 638 - (void)insertSubview:(UIView *)view above:(UIView *)sibling; 639 639 - (void)viewWillMoveToSuperview:(UIView *)newSuperview; 640 - (void)_didRemoveSubview:(UIView *)subview; 640 641 - (CGSize)convertSize:(CGSize)size toView:(UIView *)view; 641 642 - (void)_removeAllAnimations:(BOOL)includeSubviews; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r280767 r281054 123 123 @class WKMouseGestureRecognizer; 124 124 @class WKInspectorNodeSearchGestureRecognizer; 125 @class WKTargetedPreviewContainer; 125 126 @class WKTextRange; 126 127 @class _WKTextInputContext; … … 319 320 RetainPtr<_UIHighlightView> _highlightView; 320 321 RetainPtr<UIView> _interactionViewsContainerView; 321 RetainPtr< UIView> _contextMenuHintContainerView;322 RetainPtr<WKTargetedPreviewContainer> _contextMenuHintContainerView; 322 323 WeakObjCPtr<UIScrollView> _scrollViewForTargetedPreview; 323 324 CGPoint _scrollViewForTargetedPreviewInitialOffset; 324 RetainPtr< UIView> _dragPreviewContainerView;325 RetainPtr< UIView> _dropPreviewContainerView;325 RetainPtr<WKTargetedPreviewContainer> _dragPreviewContainerView; 326 RetainPtr<WKTargetedPreviewContainer> _dropPreviewContainerView; 326 327 RetainPtr<NSString> _markedText; 327 328 RetainPtr<WKActionSheetAssistant> _actionSheetAssistant; … … 732 733 - (UITargetedPreview *)_createTargetedContextMenuHintPreviewForFocusedElement; 733 734 - (UITargetedPreview *)_createTargetedContextMenuHintPreviewIfPossible; 734 - (void)_removeContextMenuViewIfPossible; 735 - (void)_removeContextMenuHintContainerIfPossible; 736 - (void)_targetedPreviewContainerDidRemoveLastSubview:(WKTargetedPreviewContainer *)containerView; 735 737 #endif 736 738 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r280767 r281054 769 769 @end 770 770 771 @interface WKTargetedPreviewContainer : UIView 772 - (instancetype)initWithContentView:(WKContentView *)contentView NS_DESIGNATED_INITIALIZER; 773 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; 774 - (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE; 775 @end 776 777 @implementation WKTargetedPreviewContainer { 778 __weak WKContentView *_contentView; 779 } 780 781 - (instancetype)initWithContentView:(WKContentView *)contentView 782 { 783 if (!(self = [super initWithFrame:CGRectZero])) 784 return nil; 785 786 _contentView = contentView; 787 return self; 788 } 789 790 - (void)_didRemoveSubview:(UIView *)subview 791 { 792 [super _didRemoveSubview:subview]; 793 794 if (self.subviews.count) 795 return; 796 797 #if USE(UICONTEXTMENU) 798 [_contentView _targetedPreviewContainerDidRemoveLastSubview:self]; 799 #endif 800 } 801 802 @end 803 771 804 @interface WKContentView (WKInteractionPrivate) 772 805 - (void)accessibilitySpeakSelectionSetContent:(NSString *)string; … … 1141 1174 1142 1175 #if USE(UICONTEXTMENU) 1143 [self _removeContextMenu ViewIfPossible];1176 [self _removeContextMenuHintContainerIfPossible]; 1144 1177 #endif // USE(UICONTEXTMENU) 1145 1178 … … 7757 7790 - (void)removeContextMenuViewIfPossibleForActionSheetAssistant:(WKActionSheetAssistant *)assistant 7758 7791 { 7759 [self _removeContextMenu ViewIfPossible];7792 [self _removeContextMenuHintContainerIfPossible]; 7760 7793 } 7761 7794 … … 7768 7801 { 7769 7802 [_webView _didDismissContextMenu]; 7803 } 7804 7805 - (void)_targetedPreviewContainerDidRemoveLastSubview:(WKTargetedPreviewContainer *)containerView 7806 { 7807 if (_contextMenuHintContainerView == containerView) 7808 [self _removeContextMenuHintContainerIfPossible]; 7770 7809 } 7771 7810 … … 7858 7897 #endif // HAVE(PASTEBOARD_DATA_OWNER) 7859 7898 7860 - (RetainPtr< UIView>)_createPreviewContainerWithLayerName:(NSString *)layerName7861 { 7862 auto container = adoptNS([[ UIView alloc] init]);7899 - (RetainPtr<WKTargetedPreviewContainer>)_createPreviewContainerWithLayerName:(NSString *)layerName 7900 { 7901 auto container = adoptNS([[WKTargetedPreviewContainer alloc] initWithContentView:self]); 7863 7902 [container layer].anchorPoint = CGPointZero; 7864 7903 [container layer].name = layerName; … … 8697 8736 } 8698 8737 8699 - (void)_removeContextMenu ViewIfPossible8738 - (void)_removeContextMenuHintContainerIfPossible 8700 8739 { 8701 8740 #if HAVE(LINK_PREVIEW) … … 8713 8752 if (_fileUploadPanel) 8714 8753 return; 8715 8754 8716 8755 // and for the date/time picker. 8717 8756 if ([self dateTimeInputControl]) … … 8720 8759 if ([self selectControl]) 8721 8760 return; 8722 8761 8762 if ([_contextMenuHintContainerView subviews].count) 8763 return; 8764 8723 8765 [self _removeContainerForContextMenuHintPreviews]; 8724 8766 } … … 11383 11425 if (!strongSelf) 11384 11426 return; 11385 [strongSelf _removeContextMenu ViewIfPossible];11427 [strongSelf _removeContextMenuHintContainerIfPossible]; 11386 11428 [strongSelf->_webView _didDismissContextMenu]; 11387 11429 }]; -
trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm
r279863 r281054 517 517 [self.view removeInteraction:_suggestionsContextMenuInteraction.get()]; 518 518 _suggestionsContextMenuInteraction = nil; 519 [self.view _removeContextMenu ViewIfPossible];519 [self.view _removeContextMenuHintContainerIfPossible]; 520 520 [self.view.webView _didDismissContextMenu]; 521 521 } -
trunk/Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm
r280398 r281054 470 470 [_view removeInteraction:_dateTimeContextMenuInteraction.get()]; 471 471 _dateTimeContextMenuInteraction = nil; 472 [_view _removeContextMenu ViewIfPossible];472 [_view _removeContextMenuHintContainerIfPossible]; 473 473 [_view.webView _didDismissContextMenu]; 474 474 } -
trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm
r280883 r281054 497 497 [_view removeInteraction:_documentContextMenuInteraction.get()]; 498 498 _documentContextMenuInteraction = nil; 499 [_view _removeContextMenu ViewIfPossible];499 [_view _removeContextMenuHintContainerIfPossible]; 500 500 } 501 501 } -
trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm
r280398 r281054 702 702 [_view removeInteraction:_selectContextMenuInteraction.get()]; 703 703 _selectContextMenuInteraction = nil; 704 [_view _removeContextMenu ViewIfPossible];704 [_view _removeContextMenuHintContainerIfPossible]; 705 705 [_view.webView _didDismissContextMenu]; 706 706 }
Note:
See TracChangeset
for help on using the changeset viewer.