Changeset 242968 in webkit
- Timestamp:
- Mar 14, 2019 3:07:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242956 r242968 1 2019-03-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does not prevent focusing the subframe 4 https://bugs.webkit.org/show_bug.cgi?id=195749 5 <rdar://problem/48892367> 6 7 Reviewed by Tim Horton. 8 9 Add a test to verify that tapping a subframe doesn't move focus into it subframe if the page prevents default 10 on touchstart. 11 12 * fast/events/touch/ios/no-focus-change-when-preventing-default-on-touchstart-expected.txt: Added. 13 * fast/events/touch/ios/no-focus-change-when-preventing-default-on-touchstart.html: Added. 14 1 15 2019-03-14 Shawn Roberts <sroberts@apple.com> 2 16 -
trunk/Source/WebKit/ChangeLog
r242960 r242968 1 2019-03-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does not prevent focusing the subframe 4 https://bugs.webkit.org/show_bug.cgi?id=195749 5 <rdar://problem/48892367> 6 7 Reviewed by Tim Horton. 8 9 r242801 added logic to fetch interaction information at the touch location upon touch start. However this, 10 combined with an existing behavior where the process of computing InteractionInformationAtPosition in WebPage 11 moves focus into the frame of the hit-tested node below the touch location, means that we'll always trigger a 12 blur event on the window and move focus into the subframe when performing a touch inside a subframe, even if the 13 page prevents default on touchstart. 14 15 To fix this, add a "readonly" flag to InteractionInformationRequest, and only change focus when requesting 16 position information in the case where the request is not readonly. For now, this readonly flag is false by 17 default; in a future patch, we should identify the (hopefully few) places that rely on position information 18 requests to move focus, explicitly turn this bit off in those places, and otherwise send readonly position 19 information requests by default. 20 21 * Shared/ios/InteractionInformationRequest.cpp: 22 (WebKit::InteractionInformationRequest::encode const): 23 (WebKit::InteractionInformationRequest::decode): 24 (WebKit::InteractionInformationRequest::isValidForRequest): 25 (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest): 26 27 Ensure that a readonly request is not valid for a non-readonly request. 28 29 * Shared/ios/InteractionInformationRequest.h: 30 * UIProcess/API/Cocoa/WKWebView.mm: 31 (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): 32 33 Send a readonly position information request in the case where a WebKit SPI client is querying for element 34 information at the given location. 35 36 * UIProcess/ios/WKContentViewInteraction.mm: 37 (-[WKContentView _webTouchEventsRecognized:]): 38 39 Send a readonly position information request on touchstart. 40 41 * WebProcess/WebPage/ios/WebPageIOS.mm: 42 (WebKit::WebPage::positionInformation): 43 1 44 2019-03-14 Chris Dumez <cdumez@apple.com> 2 45 -
trunk/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp
r237266 r242968 39 39 encoder << includeSnapshot; 40 40 encoder << includeLinkIndicator; 41 encoder << readonly; 41 42 } 42 43 … … 50 51 51 52 if (!decoder.decode(result.includeLinkIndicator)) 53 return false; 54 55 if (!decoder.decode(result.readonly)) 52 56 return false; 53 57 … … 66 70 return false; 67 71 72 if (!other.readonly && readonly) 73 return false; 74 68 75 return true; 69 76 } … … 76 83 if (other.includeLinkIndicator && !includeLinkIndicator) 77 84 return false; 85 86 if (!other.readonly && readonly) 87 return false; 78 88 79 89 return (other.point - point).diagonalLengthSquared() <= 4; -
trunk/Source/WebKit/Shared/ios/InteractionInformationRequest.h
r237266 r242968 43 43 bool includeLinkIndicator { false }; 44 44 45 // FIXME: This readonly flag ought to be true by default, but there are a number of interactions (e.g. selection) that currently 46 // rely on the fact that interaction information requests additionally change the focused frame. We should explicitly turn the 47 // readonly bit off in these scenarios, and make sure that all other position information requests don't move focus around. 48 bool readonly { false }; 49 45 50 InteractionInformationRequest() { } 46 51 explicit InteractionInformationRequest(WebCore::IntPoint point) -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r242762 r242968 6578 6578 auto infoRequest = WebKit::InteractionInformationRequest(WebCore::roundedIntPoint(position)); 6579 6579 infoRequest.includeSnapshot = true; 6580 infoRequest.readonly = true; 6580 6581 6581 6582 [_contentView doAfterPositionInformationUpdate:[capturedBlock = makeBlockPtr(block)] (WebKit::InteractionInformationAtPosition information) { -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r242833 r242968 1222 1222 _layerTreeTransactionIdAtLastTouchStart = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).lastCommittedLayerTreeTransactionID(); 1223 1223 1224 WebKit::InteractionInformationRequest positionInformationRequest { WebCore::IntPoint(_lastInteractionLocation) }; 1225 positionInformationRequest.readonly = true; 1224 1226 [self doAfterPositionInformationUpdate:[assistant = WeakObjCPtr<WKActionSheetAssistant>(_actionSheetAssistant.get())] (WebKit::InteractionInformationAtPosition information) { 1225 1227 [assistant interactionDidStartWithPositionInformation:information]; 1226 } forRequest: WebKit::InteractionInformationRequest(WebCore::IntPoint(_lastInteractionLocation))];1228 } forRequest:positionInformationRequest]; 1227 1229 } 1228 1230 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r242833 r242968 2377 2377 if (hitNode && hitNode->renderer()) { 2378 2378 RenderObject* renderer = hitNode->renderer(); 2379 m_page->focusController().setFocusedFrame(result.innerNodeFrame()); 2379 if (!request.readonly) 2380 m_page->focusController().setFocusedFrame(result.innerNodeFrame()); 2380 2381 info.bounds = renderer->absoluteBoundingBoxRect(true); 2381 2382 // We don't want to select blocks that are larger than 97% of the visible area of the document.
Note: See TracChangeset
for help on using the changeset viewer.