[iOS] Replace "node assistance" terminology in WebKit with "focused element"
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:42:45 +0000 (18:42 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:42:45 +0000 (18:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192936

Reviewed by Tim Horton.

Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
see below for more details. No new tests, because there should be no change in behavior.

* Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
(WebKit::OptionItem::encode const):
(WebKit::OptionItem::decode):
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.

Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
focusedElementIdentifier (which is currently just a `uint64_t`).

(WebKit::OptionItem::OptionItem):
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _shouldUpdateKeyboardWithInfo:]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:

Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
eventually).

(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
* UIProcess/WebPageProxy.messages.in:

Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::elementDidFocus):
(WebKit::PageClientImpl::isFocusingElement):
(WebKit::PageClientImpl::elementDidBlur):
(WebKit::PageClientImpl::startAssistingNode): Deleted.
(WebKit::PageClientImpl::isAssistingNode): Deleted.
(WebKit::PageClientImpl::stopAssistingNode): Deleted.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView isFocusingElement]):
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView isAssistingNode]): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
(hasFocusedElement):
(-[WKContentView cleanupInteraction]):
(-[WKContentView shouldHideSelectionWhenScrolling]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView inputView]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView clearSelection]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _isInteractingWithFocusedElement]):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView selectPositionAtPoint:completionHandler:]):
(-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
(-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
(-[WKContentView accessoryTab:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView accessoryClear]):
(-[WKContentView _updateAccessory]):
(-[WKContentView insertTextSuggestion:]):
(-[WKContentView setSelectedTextRange:]):
(-[WKContentView textInputTraits]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView focusedElementInformation]):
(-[WKContentView focusedSelectElementOptions]):
(rectToRevealWhenZoomingToFocusedElement):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
(-[WKContentView updateCurrentFocusedElementInformation:]):
(-[WKContentView presentViewControllerForCurrentFocusedElement]):
(-[WKContentView focusedFormControlViewDidSubmit:]):
(-[WKContentView focusedFormControlViewDidCancel:]):
(-[WKContentView focusedFormControlViewDidBeginEditing:]):
(-[WKContentView rectForFocusedFormControlView:]):
(-[WKContentView nextRectForFocusedFormControlView:]):
(-[WKContentView previousRectForFocusedFormControlView:]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView focusedFormControlViewDidRequestNextNode:]):
(-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
(-[WKContentView hasNextNodeForFocusedFormControlView:]):
(-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
(-[WKContentView selectMenu:didSelectItemAtIndex:]):
(-[WKContentView numberOfItemsInSelectMenu:]):
(-[WKContentView selectMenu:displayTextForItemAtIndex:]):
(-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
(-[WKContentView selectMenuUsesMultipleSelection:]):
(-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _autofillContext]):
(-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView inputLabelTextForViewController:]):
(-[WKContentView initialValueForViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
(hasAssistedNode): Deleted.

Replaced with hasFocusedElement.

(-[WKContentView _isInteractingWithAssistedNode]): Deleted.
(-[WKContentView assistedNodeInformation]): Deleted.
(-[WKContentView assistedNodeSelectOptions]): Deleted.
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
(-[WKContentView _stopAssistingNode]): Deleted.
(-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
(-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsControl textAlignment]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::focusedElementInformationCallback):
(WebKit::WebPageProxy::requestFocusedElementInformation):
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::blurFocusedElement):
(WebKit::WebPageProxy::elementDidFocus):
(WebKit::WebPageProxy::elementDidBlur):
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::setFocusedElementValue):
(WebKit::WebPageProxy::setFocusedElementValueAsNumber):
(WebKit::WebPageProxy::setFocusedElementSelectedIndex):
(WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
(WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
(WebKit::WebPageProxy::blurAssistedNode): Deleted.
(WebKit::WebPageProxy::startAssistingNode): Deleted.
(WebKit::WebPageProxy::stopAssistingNode): Deleted.
(WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
(WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
(WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
(WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
* UIProcess/ios/forms/WKFormColorPicker.mm:
(-[WKColorPicker initWithView:]):
(-[WKColorPicker setControlValueFromUIColor:]):
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePicker initWithView:datePickerMode:]):
(-[WKDateTimePicker shouldPresentGregorianCalendar:]):
(-[WKDateTimePicker _dateChangedSetAsNumber]):
(-[WKDateTimePicker _dateChangedSetAsString]):
(-[WKDateTimePicker controlBeginEditing]):
(-[WKFormInputControl initWithView:]):
(-[WKDateTimePopover clear:]):
(-[WKDateTimePopover initWithView:datePickerMode:]):
* UIProcess/ios/forms/WKFormPopover.mm:
(-[WKRotatingPopover presentPopoverAnimated:]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl initWithView:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker initWithView:]):
(-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
(-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
(-[WKMultipleSelectPicker findItemIndexAt:]):
(-[WKMultipleSelectPicker pickerView:row:column:checked:]):
(-[WKSelectSinglePicker initWithView:]):
(-[WKSelectSinglePicker controlEndEditing]):
(-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
(-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
(-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController initWithView:hasGroups:]):
(-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
(-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
(-[WKSelectTableViewController findItemIndexAt:]):
(-[WKSelectTableViewController findItemAt:]):
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::elementDidFocus):
(WebKit::WebChromeClient::elementDidRefocus):
(WebKit::WebChromeClient::elementDidBlur):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::setTextAsync):
(WebKit::WebPage::resetFocusedElementForFrame):
(WebKit::WebPage::elementDidRefocus):
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::elementDidBlur):
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
* WebProcess/WebPage/WebPage.h:

Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.

* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:

Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).

(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::requestFocusedElementInformation):
(WebKit::WebPage::blurFocusedElement):
(WebKit::WebPage::setFocusedElementValue):
(WebKit::WebPage::setFocusedElementValueAsNumber):
(WebKit::WebPage::setFocusedElementSelectedIndex):
(WebKit::innerFrameQuad):
(WebKit::constrainPoint):
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::startAutoscrollAtPosition):
(WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::rangeForGranularityAtPoint):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::focusNextFocusedElement):
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::WebPage::autofillLoginCredentials):
(WebKit::WebPage::requestAssistedNodeInformation): Deleted.
(WebKit::WebPage::blurAssistedNode): Deleted.
(WebKit::WebPage::setAssistedNodeValue): Deleted.
(WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
(WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
(WebKit::WebPage::focusNextAssistedNode): Deleted.
(WebKit::WebPage::getAssistedNodeInformation): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239454 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/FocusedElementInformation.cpp [moved from Source/WebKit/Shared/AssistedNodeInformation.cpp with 94% similarity]
Source/WebKit/Shared/FocusedElementInformation.h [moved from Source/WebKit/Shared/AssistedNodeInformation.h with 94% similarity]
Source/WebKit/Shared/ios/InteractionInformationAtPosition.h
Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/ios/WKContentView.h
Source/WebKit/UIProcess/ios/WKContentView.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm
Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm
Source/WebKit/UIProcess/ios/forms/WKFormPopover.mm
Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.h
Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm
Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm
Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

index d1e7fe4..74d31f0 100644 (file)
@@ -1,3 +1,256 @@
+2018-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Replace "node assistance" terminology in WebKit with "focused element"
+        https://bugs.webkit.org/show_bug.cgi?id=192936
+
+        Reviewed by Tim Horton.
+
+        Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes";
+        see below for more details. No new tests, because there should be no change in behavior.
+
+        * Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp.
+        (WebKit::OptionItem::encode const):
+        (WebKit::OptionItem::decode):
+        (WebKit::FocusedElementInformation::encode const):
+        (WebKit::FocusedElementInformation::decode):
+        * Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h.
+
+        Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the
+        focusedElementIdentifier (which is currently just a `uint64_t`).
+
+        (WebKit::OptionItem::OptionItem):
+        * Shared/ios/InteractionInformationAtPosition.h:
+        * Shared/ios/InteractionInformationAtPosition.mm:
+        (WebKit::InteractionInformationAtPosition::encode const):
+        (WebKit::InteractionInformationAtPosition::decode):
+        * SourcesCocoa.txt:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::resetStateAfterProcessExited):
+        * UIProcess/WebPageProxy.h:
+
+        Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism
+        eventually).
+
+        (WebKit::WebPageProxy::focusNextFocusedElement):
+        (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
+        * UIProcess/WebPageProxy.messages.in:
+
+        Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur.
+
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::elementDidFocus):
+        (WebKit::PageClientImpl::isFocusingElement):
+        (WebKit::PageClientImpl::elementDidBlur):
+        (WebKit::PageClientImpl::startAssistingNode): Deleted.
+        (WebKit::PageClientImpl::isAssistingNode): Deleted.
+        (WebKit::PageClientImpl::stopAssistingNode): Deleted.
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView isFocusingElement]):
+        (-[WKContentView _didCommitLoadForMainFrame]):
+        (-[WKContentView isAssistingNode]): Deleted.
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
+        (hasFocusedElement):
+        (-[WKContentView cleanupInteraction]):
+        (-[WKContentView shouldHideSelectionWhenScrolling]):
+        (-[WKContentView resignFirstResponderForWebView]):
+        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
+        (-[WKContentView _requiresKeyboardWhenFirstResponder]):
+        (-[WKContentView _zoomToRevealFocusedElement]):
+        (-[WKContentView inputView]):
+        (-[WKContentView _selectionClipRect]):
+        (-[WKContentView gestureRecognizerShouldBegin:]):
+        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
+        (-[WKContentView clearSelection]):
+        (-[WKContentView requiresAccessoryView]):
+        (-[WKContentView canPerformActionForWebView:withSender:]):
+        (-[WKContentView _isInteractingWithFocusedElement]):
+        (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
+        (-[WKContentView selectPositionAtPoint:completionHandler:]):
+        (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
+        (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
+        (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
+        (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
+        (-[WKContentView accessoryTab:]):
+        (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
+        (-[WKContentView accessoryClear]):
+        (-[WKContentView _updateAccessory]):
+        (-[WKContentView insertTextSuggestion:]):
+        (-[WKContentView setSelectedTextRange:]):
+        (-[WKContentView textInputTraits]):
+        (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
+        (-[WKContentView focusedElementInformation]):
+        (-[WKContentView focusedSelectElementOptions]):
+        (rectToRevealWhenZoomingToFocusedElement):
+        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
+        (-[WKContentView _elementDidBlur]):
+        (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
+        (-[WKContentView updateCurrentFocusedElementInformation:]):
+        (-[WKContentView presentViewControllerForCurrentFocusedElement]):
+        (-[WKContentView focusedFormControlViewDidSubmit:]):
+        (-[WKContentView focusedFormControlViewDidCancel:]):
+        (-[WKContentView focusedFormControlViewDidBeginEditing:]):
+        (-[WKContentView rectForFocusedFormControlView:]):
+        (-[WKContentView nextRectForFocusedFormControlView:]):
+        (-[WKContentView previousRectForFocusedFormControlView:]):
+        (-[WKContentView actionNameForFocusedFormControlView:]):
+        (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
+        (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
+        (-[WKContentView hasNextNodeForFocusedFormControlView:]):
+        (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
+        (-[WKContentView selectMenu:didSelectItemAtIndex:]):
+        (-[WKContentView numberOfItemsInSelectMenu:]):
+        (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
+        (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
+        (-[WKContentView selectMenuUsesMultipleSelection:]):
+        (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
+        (-[WKContentView _updateChangedSelection:]):
+        (-[WKContentView _autofillContext]):
+        (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
+        (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
+        (-[WKContentView inputLabelTextForViewController:]):
+        (-[WKContentView initialValueForViewController:]):
+        (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
+        (-[WKContentView numericInputModeForListViewController:]):
+        (-[WKContentView textContentTypeForListViewController:]):
+        (-[WKContentView allowsDictationInputForListViewController:]):
+        (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted.
+        (hasAssistedNode): Deleted.
+
+        Replaced with hasFocusedElement.
+
+        (-[WKContentView _isInteractingWithAssistedNode]): Deleted.
+        (-[WKContentView assistedNodeInformation]): Deleted.
+        (-[WKContentView assistedNodeSelectOptions]): Deleted.
+        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted.
+        (-[WKContentView _stopAssistingNode]): Deleted.
+        (-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted.
+        (-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted.
+        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
+        (-[WKDataListSuggestionsControl textAlignment]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::focusedElementInformationCallback):
+        (WebKit::WebPageProxy::requestFocusedElementInformation):
+        (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
+        (WebKit::WebPageProxy::didCommitLayerTree):
+        (WebKit::WebPageProxy::selectWithGesture):
+        (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
+        (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
+        (WebKit::WebPageProxy::selectPositionAtPoint):
+        (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
+        (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
+        (WebKit::WebPageProxy::blurFocusedElement):
+        (WebKit::WebPageProxy::elementDidFocus):
+        (WebKit::WebPageProxy::elementDidBlur):
+        (WebKit::WebPageProxy::focusNextFocusedElement):
+        (WebKit::WebPageProxy::setFocusedElementValue):
+        (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
+        (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
+        (WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted.
+        (WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted.
+        (WebKit::WebPageProxy::blurAssistedNode): Deleted.
+        (WebKit::WebPageProxy::startAssistingNode): Deleted.
+        (WebKit::WebPageProxy::stopAssistingNode): Deleted.
+        (WebKit::WebPageProxy::focusNextAssistedNode): Deleted.
+        (WebKit::WebPageProxy::setAssistedNodeValue): Deleted.
+        (WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted.
+        (WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted.
+        * UIProcess/ios/forms/WKFormColorPicker.mm:
+        (-[WKColorPicker initWithView:]):
+        (-[WKColorPicker setControlValueFromUIColor:]):
+        * UIProcess/ios/forms/WKFormInputControl.mm:
+        (-[WKDateTimePicker initWithView:datePickerMode:]):
+        (-[WKDateTimePicker shouldPresentGregorianCalendar:]):
+        (-[WKDateTimePicker _dateChangedSetAsNumber]):
+        (-[WKDateTimePicker _dateChangedSetAsString]):
+        (-[WKDateTimePicker controlBeginEditing]):
+        (-[WKFormInputControl initWithView:]):
+        (-[WKDateTimePopover clear:]):
+        (-[WKDateTimePopover initWithView:datePickerMode:]):
+        * UIProcess/ios/forms/WKFormPopover.mm:
+        (-[WKRotatingPopover presentPopoverAnimated:]):
+        * UIProcess/ios/forms/WKFormSelectControl.h:
+        * UIProcess/ios/forms/WKFormSelectControl.mm:
+        (-[WKFormSelectControl initWithView:]):
+        * UIProcess/ios/forms/WKFormSelectPicker.mm:
+        (-[WKMultipleSelectPicker initWithView:]):
+        (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
+        (-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]):
+        (-[WKMultipleSelectPicker findItemIndexAt:]):
+        (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
+        (-[WKSelectSinglePicker initWithView:]):
+        (-[WKSelectSinglePicker controlEndEditing]):
+        (-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]):
+        (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
+        (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
+        * UIProcess/ios/forms/WKFormSelectPopover.mm:
+        (-[WKSelectTableViewController initWithView:hasGroups:]):
+        (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
+        (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
+        (-[WKSelectTableViewController findItemIndexAt:]):
+        (-[WKSelectTableViewController findItemAt:]):
+        (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
+        (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
+        (-[WKSelectPopover initWithView:hasGroups:]):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::elementDidFocus):
+        (WebKit::WebChromeClient::elementDidRefocus):
+        (WebKit::WebChromeClient::elementDidBlur):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didStartPageTransition):
+        (WebKit::WebPage::setTextAsync):
+        (WebKit::WebPage::resetFocusedElementForFrame):
+        (WebKit::WebPage::elementDidRefocus):
+        (WebKit::WebPage::elementDidFocus):
+        (WebKit::WebPage::elementDidBlur):
+        (WebKit::WebPage::didCommitLoad):
+        (WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+
+        Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`.
+
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+
+        Replace m_assistedNode (a `RefPtr<Node>`) with m_focusedElement (a `RefPtr<Element>`).
+
+        (WebKit::WebPage::platformEditorState const):
+        (WebKit::WebPage::completeSyntheticClick):
+        (WebKit::WebPage::requestFocusedElementInformation):
+        (WebKit::WebPage::blurFocusedElement):
+        (WebKit::WebPage::setFocusedElementValue):
+        (WebKit::WebPage::setFocusedElementValueAsNumber):
+        (WebKit::WebPage::setFocusedElementSelectedIndex):
+        (WebKit::innerFrameQuad):
+        (WebKit::constrainPoint):
+        (WebKit::WebPage::selectWithGesture):
+        (WebKit::WebPage::startAutoscrollAtPosition):
+        (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
+        (WebKit::WebPage::selectPositionAtPoint):
+        (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
+        (WebKit::WebPage::rangeForGranularityAtPoint):
+        (WebKit::WebPage::selectTextWithGranularityAtPoint):
+        (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
+        (WebKit::WebPage::updateSelectionWithExtentPoint):
+        (WebKit::WebPage::getPositionInformation):
+        (WebKit::WebPage::focusNextFocusedElement):
+        (WebKit::WebPage::getFocusedElementInformation):
+        (WebKit::WebPage::autofillLoginCredentials):
+        (WebKit::WebPage::requestAssistedNodeInformation): Deleted.
+        (WebKit::WebPage::blurAssistedNode): Deleted.
+        (WebKit::WebPage::setAssistedNodeValue): Deleted.
+        (WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted.
+        (WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted.
+        (WebKit::WebPage::focusNextAssistedNode): Deleted.
+        (WebKit::WebPage::getAssistedNodeInformation): Deleted.
+
 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
 
         WKWebView default UA doesn't freeze the build number
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "AssistedNodeInformation.h"
+#include "FocusedElementInformation.h"
 
 #include "WebCoreArgumentCoders.h"
 
@@ -61,7 +61,7 @@ Optional<OptionItem> OptionItem::decode(IPC::Decoder& decoder)
     return WTFMove(result);
 }
 
-void AssistedNodeInformation::encode(IPC::Encoder& encoder) const
+void FocusedElementInformation::encode(IPC::Encoder& encoder) const
 {
     encoder << elementRect;
     encoder << elementInteractionLocation;
@@ -98,7 +98,7 @@ void AssistedNodeInformation::encode(IPC::Encoder& encoder) const
     encoder << label;
     encoder << ariaLabel;
     encoder << embeddedViewID;
-    encoder << assistedNodeIdentifier;
+    encoder << focusedElementIdentifier;
 #if ENABLE(DATALIST_ELEMENT)
     encoder << hasSuggestions;
 #if ENABLE(INPUT_TYPE_COLOR)
@@ -107,7 +107,7 @@ void AssistedNodeInformation::encode(IPC::Encoder& encoder) const
 #endif
 }
 
-bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformation& result)
+bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInformation& result)
 {
     if (!decoder.decode(result.elementRect))
         return false;
@@ -214,7 +214,7 @@ bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformat
     if (!decoder.decode(result.embeddedViewID))
         return false;
 
-    if (!decoder.decode(result.assistedNodeIdentifier))
+    if (!decoder.decode(result.focusedElementIdentifier))
         return false;
 
 #if ENABLE(DATALIST_ELEMENT)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -93,7 +93,9 @@ struct OptionItem {
     static Optional<OptionItem> decode(IPC::Decoder&);
 };
 
-struct AssistedNodeInformation {
+using FocusedElementIdentifier = uint64_t;
+
+struct FocusedElementInformation {
     WebCore::IntRect elementRect;
     WebCore::IntPoint elementInteractionLocation;
     double minimumScaleFactor { -INFINITY };
@@ -136,10 +138,10 @@ struct AssistedNodeInformation {
 #endif
 #endif
 
-    uint64_t assistedNodeIdentifier { 0 };
+    FocusedElementIdentifier focusedElementIdentifier { 0 };
 
     void encode(IPC::Encoder&) const;
-    static bool decode(IPC::Decoder&, AssistedNodeInformation&);
+    static bool decode(IPC::Decoder&, FocusedElementInformation&);
 };
 #endif
 
index 4a30abf..71bce80 100644 (file)
@@ -41,7 +41,7 @@ namespace WebKit {
 struct InteractionInformationAtPosition {
     InteractionInformationRequest request;
 
-    bool nodeAtPositionIsAssistedNode { false };
+    bool nodeAtPositionIsFocusedElement { false };
 #if ENABLE(DATA_INTERACTION)
     bool hasSelectionAtPosition { false };
 #endif
index fd70310..acda819 100644 (file)
@@ -43,7 +43,7 @@ void InteractionInformationAtPosition::encode(IPC::Encoder& encoder) const
 {
     encoder << request;
 
-    encoder << nodeAtPositionIsAssistedNode;
+    encoder << nodeAtPositionIsFocusedElement;
 #if ENABLE(DATA_INTERACTION)
     encoder << hasSelectionAtPosition;
 #endif
@@ -89,7 +89,7 @@ bool InteractionInformationAtPosition::decode(IPC::Decoder& decoder, Interaction
     if (!decoder.decode(result.request))
         return false;
 
-    if (!decoder.decode(result.nodeAtPositionIsAssistedNode))
+    if (!decoder.decode(result.nodeAtPositionIsFocusedElement))
         return false;
 
 #if ENABLE(DATA_INTERACTION)
index ed65b8f..9d7cc5c 100644 (file)
@@ -110,7 +110,7 @@ Shared/API/Cocoa/WKRemoteObjectCoder.mm
 
 Shared/APIWebArchive.mm
 Shared/APIWebArchiveResource.mm
-Shared/AssistedNodeInformation.cpp
+Shared/FocusedElementInformation.cpp
 Shared/VisibleContentRectUpdateInfo.cpp
 Shared/WebSQLiteDatabaseTracker.cpp
 
index 3d3c1ed..b2d33c4 100644 (file)
@@ -3151,7 +3151,7 @@ static int32_t activeOrientation(WKWebView *webView)
 
 - (BOOL)_shouldUpdateKeyboardWithInfo:(NSDictionary *)keyboardInfo
 {
-    if ([_contentView isAssistingNode])
+    if ([_contentView isFocusingElement])
         return YES;
 
     NSNumber *isLocalKeyboard = [keyboardInfo valueForKey:UIKeyboardIsLocalUserInfoKey];
index bed6d18..c722b7d 100644 (file)
@@ -123,7 +123,7 @@ class WebPopupMenuProxy;
 
 enum class ContinueUnsafeLoad : bool { No, Yes };
 
-struct AssistedNodeInformation;
+struct FocusedElementInformation;
 struct InteractionInformationAtPosition;
 struct WebHitTestResultData;
 
@@ -362,10 +362,10 @@ public:
     virtual void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0;
     virtual void restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) = 0;
 
-    virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0;
-    virtual void stopAssistingNode() = 0;
+    virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0;
+    virtual void elementDidBlur() = 0;
     virtual void didReceiveEditorStateUpdateAfterFocus() = 0;
-    virtual bool isAssistingNode() = 0;
+    virtual bool isFocusingElement() = 0;
     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;
     virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0;
     virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0;
index 4b01252..f66f73d 100644 (file)
@@ -6483,7 +6483,7 @@ void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason termina
 
 #if PLATFORM(IOS_FAMILY)
     m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false;
-    m_deferredNodeAssistanceArguments = nullptr;
+    m_deferredElementDidFocusArguments = nullptr;
     m_activityToken = nullptr;
 #endif
 
index ca51048..156f144 100644 (file)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "APIObject.h"
-#include "AssistedNodeInformation.h"
 #include "AutoCorrectionCallback.h"
 #include "Connection.h"
 #include "ContextMenuContextData.h"
@@ -34,6 +33,7 @@
 #include "DragControllerAction.h"
 #include "EditingRange.h"
 #include "EditorState.h"
+#include "FocusedElementInformation.h"
 #include "GeolocationPermissionRequestManagerProxy.h"
 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
 #include "LayerTreeContext.h"
@@ -311,13 +311,13 @@ typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
-typedef GenericCallback<const AssistedNodeInformation&> AssistedNodeInformationCallback;
-struct NodeAssistanceArguments {
-    AssistedNodeInformation m_nodeInformation;
-    bool m_userIsInteracting;
-    bool m_blurPreviousNode;
-    bool m_changingActivityState;
-    RefPtr<API::Object> m_userData;
+typedef GenericCallback<const FocusedElementInformation&> FocusedElementInformationCallback;
+struct ElementDidFocusArguments {
+    FocusedElementInformation information;
+    bool userIsInteracting;
+    bool blurPreviousNode;
+    bool changingActivityState;
+    RefPtr<API::Object> userData;
 };
 
 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
@@ -615,19 +615,19 @@ public:
     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
     void willCommitLayerTree(uint64_t transactionID);
 
-    void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
+    void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WTF::Function<void(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
     void extendSelection(WebCore::TextGranularity);
     void selectWordBackward();
     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
-    void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
-    void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
-    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
+    void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
+    void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
+    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
-    void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
-    void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
+    void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
+    void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
     void requestAutocorrectionData(const String& textForAutocorrection, WTF::Function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>&&);
     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
     bool applyAutocorrection(const String& correction, const String& originalText);
@@ -642,10 +642,10 @@ public:
     void stopInteraction();
     void performActionOnElement(uint32_t action);
     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
-    void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
-    void setAssistedNodeValue(const String&);
-    void setAssistedNodeValueAsNumber(double);
-    void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
+    void focusNextFocusedElement(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
+    void setFocusedElementValue(const String&);
+    void setFocusedElementValueAsNumber(double);
+    void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
     void applicationDidEnterBackground();
     void applicationDidFinishSnapshottingAfterEnteringBackground();
     void applicationWillEnterForeground();
@@ -1152,7 +1152,7 @@ public:
     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
 
-    void blurAssistedNode();
+    void blurFocusedElement();
 #endif
 
     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
@@ -1201,7 +1201,7 @@ public:
     void recordAutomaticNavigationSnapshot();
     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
     void recordNavigationSnapshot(WebBackForwardListItem&);
-    void requestAssistedNodeInformation(Function<void(const AssistedNodeInformation&, CallbackBase::Error)>&&);
+    void requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&&);
 
 #if PLATFORM(COCOA)
     RefPtr<ViewSnapshot> takeViewSnapshot();
@@ -1773,8 +1773,8 @@ private:
 
     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
 
-    void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
-    void stopAssistingNode();
+    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
+    void elementDidBlur();
     void didReceiveEditorStateUpdateAfterFocus();
 
     void showInspectorHighlight(const WebCore::Highlight&);
@@ -1782,7 +1782,7 @@ private:
 
     void enableInspectorNodeSearch();
     void disableInspectorNodeSearch();
-    void assistedNodeInformationCallback(const AssistedNodeInformation&, CallbackID);
+    void focusedElementInformationCallback(const FocusedElementInformation&, CallbackID);
 #endif // PLATFORM(IOS_FAMILY)
 
 #if ENABLE(DATA_DETECTION)
@@ -2267,7 +2267,7 @@ private:
 #endif
 
 #if PLATFORM(IOS_FAMILY)
-    std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
+    std::unique_ptr<ElementDidFocusArguments> m_deferredElementDidFocusArguments;
     bool m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement { false };
     bool m_forceAlwaysUserScalable { false };
     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
index b11fcb1..1e4518f 100644 (file)
@@ -403,13 +403,13 @@ messages -> WebPageProxy {
     RestorePageCenterAndScale(Optional<WebCore::FloatPoint> unobscuredCenter, double scale)
     DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
 
-    StartAssistingNode(struct WebKit::AssistedNodeInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData)
-    StopAssistingNode()
+    ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData)
+    ElementDidBlur()
     ScrollingNodeScrollWillStartScroll()
     ScrollingNodeScrollDidEndScroll()
     ShowInspectorHighlight(struct WebCore::Highlight highlight)
     HideInspectorHighlight()
-    AssistedNodeInformationCallback(struct WebKit::AssistedNodeInformation information, WebKit::CallbackID callbackID)
+    FocusedElementInformationCallback(struct WebKit::FocusedElementInformation information, WebKit::CallbackID callbackID)
 
     ShowInspectorIndication()
     HideInspectorIndication()
index 157a310..a8e1d6a 100644 (file)
@@ -139,10 +139,10 @@ private:
     void restorePageState(Optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override;
     void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double) override;
 
-    void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override;
-    void stopAssistingNode() override;
+    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override;
+    void elementDidBlur() override;
     void didReceiveEditorStateUpdateAfterFocus() override;
-    bool isAssistingNode() override;
+    bool isFocusingElement() override;
     void selectionDidChange() override;
     bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) override;
     void positionInformationDidChange(const InteractionInformationAtPosition&) override;
index b8a6fe7..e929e20 100644 (file)
@@ -555,7 +555,7 @@ void PageClientImpl::restorePageCenterAndScale(Optional<WebCore::FloatPoint> cen
     [m_webView _restorePageStateToUnobscuredCenter:center scale:scale];
 }
 
-void PageClientImpl::startAssistingNode(const AssistedNodeInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData)
+void PageClientImpl::elementDidFocus(const FocusedElementInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData)
 {
     MESSAGE_CHECK(!userData || userData->type() == API::Object::Type::Data);
 
@@ -570,17 +570,17 @@ void PageClientImpl::startAssistingNode(const AssistedNodeInformation& nodeInfor
         }
     }
 
-    [m_contentView _startAssistingNode:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode changingActivityState:changingActivityState userObject:userObject];
+    [m_contentView _elementDidFocus:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode changingActivityState:changingActivityState userObject:userObject];
 }
 
-bool PageClientImpl::isAssistingNode()
+bool PageClientImpl::isFocusingElement()
 {
-    return [m_contentView isAssistingNode];
+    return [m_contentView isFocusingElement];
 }
 
-void PageClientImpl::stopAssistingNode()
+void PageClientImpl::elementDidBlur()
 {
-    [m_contentView _stopAssistingNode];
+    [m_contentView _elementDidBlur];
 }
 
 void PageClientImpl::didReceiveEditorStateUpdateAfterFocus()
index 687a20b..11fd8a0 100644 (file)
@@ -61,7 +61,7 @@ class WebProcessPool;
 #pragma clang diagnostic pop
 
 @property (nonatomic, readonly) WebKit::WebPageProxy* page;
-@property (nonatomic, readonly) BOOL isAssistingNode;
+@property (nonatomic, readonly) BOOL isFocusingElement;
 @property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
 @property (nonatomic, readonly, getter=isResigningFirstResponder) BOOL resigningFirstResponder;
 @property (nonatomic) BOOL sizeChangedSinceLastVisibleContentRectUpdate;
index 6afbcb8..eb2aed5 100644 (file)
@@ -300,7 +300,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     return toAPI(_page.get());
 }
 
-- (BOOL)isAssistingNode
+- (BOOL)isFocusingElement
 {
     return [self isEditable];
 }
@@ -544,7 +544,7 @@ static void storeAccessibilityRemoteConnectionInformation(id element, pid_t pid,
 
 - (void)_didCommitLoadForMainFrame
 {
-    [self _stopAssistingNode];
+    [self _elementDidBlur];
     [self _cancelLongPressGestureRecognizer];
     [_webView _didCommitLoadForMainFrame];
 }
index 4d8c140..c1f6474 100644 (file)
@@ -31,9 +31,9 @@
 #import "WKShareSheet.h"
 #endif
 
-#import "AssistedNodeInformation.h"
 #import "DragDropInteractionState.h"
 #import "EditorState.h"
+#import "FocusedElementInformation.h"
 #import "GestureTypes.h"
 #import "InteractionInformationAtPosition.h"
 #import "UIKitSPI.h"
@@ -261,7 +261,7 @@ struct WKAutoCorrectionData {
 
     WebKit::WKAutoCorrectionData _autocorrectionData;
     WebKit::InteractionInformationAtPosition _positionInformation;
-    WebKit::AssistedNodeInformation _assistedNodeInformation;
+    WebKit::FocusedElementInformation _focusedElementInformation;
     RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral;
     RetainPtr<UIEvent> _uiEventBeingResent;
     BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler;
@@ -353,7 +353,7 @@ struct WKAutoCorrectionData {
 @property (nonatomic, readonly) BOOL shouldHideSelectionWhenScrolling;
 @property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
 @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData;
-@property (nonatomic, readonly) const WebKit::AssistedNodeInformation& assistedNodeInformation;
+@property (nonatomic, readonly) const WebKit::FocusedElementInformation& focusedElementInformation;
 @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView;
 @property (nonatomic, readonly) UITextInputAssistantItem *inputAssistantItemForWebView;
 
@@ -393,8 +393,8 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 
 - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
-- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
-- (void)_stopAssistingNode;
+- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
+- (void)_elementDidBlur;
 - (void)_didReceiveEditorStateUpdateAfterFocus;
 - (void)_selectionChanged;
 - (void)_updateChangedSelection;
@@ -411,7 +411,7 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 - (void)_showShareSheet:(const WebCore::ShareDataWithParsedURL&)shareData completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
 - (void)accessoryDone;
 - (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
-- (Vector<WebKit::OptionItem>&) assistedNodeSelectOptions;
+- (Vector<WebKit::OptionItem>&) focusedSelectElementOptions;
 - (void)_enableInspectorNodeSearch;
 - (void)_disableInspectorNodeSearch;
 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler;
index 5e399fd..f269395 100644 (file)
@@ -281,7 +281,7 @@ const CGFloat minimumTapHighlightRadius = 2.0;
 @protocol UISelectionInteractionAssistant;
 
 @interface WKFocusedElementInfo : NSObject <_WKFocusedElementInfo>
-- (instancetype)initWithAssistedNodeInformation:(const WebKit::AssistedNodeInformation&)information isUserInitiated:(BOOL)isUserInitiated userObject:(NSObject <NSSecureCoding> *)userObject;
+- (instancetype)initWithFocusedElementInformation:(const WebKit::FocusedElementInformation&)information isUserInitiated:(BOOL)isUserInitiated userObject:(NSObject <NSSecureCoding> *)userObject;
 @end
 
 @implementation WKFormInputSession {
@@ -441,7 +441,7 @@ const CGFloat minimumTapHighlightRadius = 2.0;
     RetainPtr<NSString> _label;
 }
 
-- (instancetype)initWithAssistedNodeInformation:(const WebKit::AssistedNodeInformation&)information isUserInitiated:(BOOL)isUserInitiated userObject:(NSObject <NSSecureCoding> *)userObject
+- (instancetype)initWithFocusedElementInformation:(const WebKit::FocusedElementInformation&)information isUserInitiated:(BOOL)isUserInitiated userObject:(NSObject <NSSecureCoding> *)userObject
 {
     if (!(self = [super init]))
         return nil;
@@ -609,9 +609,9 @@ static WKDragSessionContext *ensureLocalDragSessionContext(id <UIDragSession> se
 
 @implementation WKContentView (WKInteraction)
 
-static inline bool hasAssistedNode(WebKit::AssistedNodeInformation assistedNodeInformation)
+static inline bool hasFocusedElement(WebKit::FocusedElementInformation focusedElementInformation)
 {
-    return (assistedNodeInformation.elementType != WebKit::InputType::None);
+    return (focusedElementInformation.elementType != WebKit::InputType::None);
 }
 
 - (WKFormInputSession *)_formInputSession
@@ -843,7 +843,7 @@ static inline bool hasAssistedNode(WebKit::AssistedNodeInformation assistedNodeI
 #endif
 
     _inputViewUpdateDeferrer = nullptr;
-    _assistedNodeInformation = { };
+    _focusedElementInformation = { };
     
     [_keyboardScrollingAnimator invalidate];
     _keyboardScrollingAnimator = nil;
@@ -1008,7 +1008,7 @@ static inline bool hasAssistedNode(WebKit::AssistedNodeInformation assistedNodeI
 - (BOOL)shouldHideSelectionWhenScrolling
 {
     if (_isEditable)
-        return _assistedNodeInformation.insideFixedPosition;
+        return _focusedElementInformation.insideFixedPosition;
 
     auto& editorState = _page->editorState();
     return !editorState.isMissingPostLayoutData && editorState.postLayoutData().insideFixedPosition;
@@ -1090,7 +1090,7 @@ static inline bool hasAssistedNode(WebKit::AssistedNodeInformation assistedNodeI
     if (!_webView._retainingActiveFocusedState) {
         // We need to complete the editing operation before we blur the element.
         [self _endEditing];
-        _page->blurAssistedNode();
+        _page->blurFocusedElement();
     }
 
     [self _cancelInteraction];
@@ -1300,7 +1300,7 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
     if (!_isTapHighlightIDValid || _latestTapID != requestID)
         return;
 
-    if (hasAssistedNode(_assistedNodeInformation) && _positionInformation.nodeAtPositionIsAssistedNode)
+    if (hasFocusedElement(_focusedElementInformation) && _positionInformation.nodeAtPositionIsFocusedElement)
         return;
 
     _isTapHighlightIDValid = NO;
@@ -1372,7 +1372,7 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
 - (BOOL)_requiresKeyboardWhenFirstResponder
 {
     // FIXME: We should add the logic to handle keyboard visibility during focus redirects.
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::None:
     case WebKit::InputType::Drawing:
         return NO;
@@ -1386,7 +1386,7 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
     case WebKit::InputType::Time:
         return !currentUserInterfaceIdiomIsPad();
     default:
-        return !_assistedNodeInformation.isReadOnly;
+        return !_focusedElementInformation.isReadOnly;
     }
     return NO;
 }
@@ -1404,26 +1404,26 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
     SetForScope<BOOL> isZoomingToRevealFocusedElementForScope { _isZoomingToRevealFocusedElement, YES };
     // In case user scaling is force enabled, do not use that scaling when zooming in with an input field.
     // Zooming above the page's default scale factor should only happen when the user performs it.
-    [self _zoomToFocusRect:_assistedNodeInformation.elementRect
-        selectionRect:_didAccessoryTabInitiateFocus ? WebCore::FloatRect() : rectToRevealWhenZoomingToFocusedElement(_assistedNodeInformation, _page->editorState())
-        insideFixed:_assistedNodeInformation.insideFixedPosition
-        fontSize:_assistedNodeInformation.nodeFontSize
-        minimumScale:_assistedNodeInformation.minimumScaleFactor
-        maximumScale:_assistedNodeInformation.maximumScaleFactorIgnoringAlwaysScalable
-        allowScaling:_assistedNodeInformation.allowsUserScalingIgnoringAlwaysScalable && !currentUserInterfaceIdiomIsPad()
-        forceScroll:(_assistedNodeInformation.inputMode == WebCore::InputMode::None) ? !currentUserInterfaceIdiomIsPad() : [self requiresAccessoryView]];
+    [self _zoomToFocusRect:_focusedElementInformation.elementRect
+        selectionRect:_didAccessoryTabInitiateFocus ? WebCore::FloatRect() : rectToRevealWhenZoomingToFocusedElement(_focusedElementInformation, _page->editorState())
+        insideFixed:_focusedElementInformation.insideFixedPosition
+        fontSize:_focusedElementInformation.nodeFontSize
+        minimumScale:_focusedElementInformation.minimumScaleFactor
+        maximumScale:_focusedElementInformation.maximumScaleFactorIgnoringAlwaysScalable
+        allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && !currentUserInterfaceIdiomIsPad()
+        forceScroll:(_focusedElementInformation.inputMode == WebCore::InputMode::None) ? !currentUserInterfaceIdiomIsPad() : [self requiresAccessoryView]];
 }
 
 - (UIView *)inputView
 {
-    if (!hasAssistedNode(_assistedNodeInformation))
+    if (!hasFocusedElement(_focusedElementInformation))
         return nil;
 
-    if (_assistedNodeInformation.inputMode == WebCore::InputMode::None)
+    if (_focusedElementInformation.inputMode == WebCore::InputMode::None)
         return [[UIView new] autorelease];
 
     if (!_inputPeripheral) {
-        switch (_assistedNodeInformation.elementType) {
+        switch (_focusedElementInformation.elementType) {
         case WebKit::InputType::Select:
             _inputPeripheral = adoptNS([[WKFormSelectControl alloc] initWithView:self]);
             break;
@@ -1463,7 +1463,7 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
 
 - (CGRect)_selectionClipRect
 {
-    if (!hasAssistedNode(_assistedNodeInformation))
+    if (!hasFocusedElement(_focusedElementInformation))
         return CGRectNull;
     return _page->editorState().postLayoutData().selectionClipRect;
 }
@@ -1725,18 +1725,18 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
         || gestureRecognizer == _nonBlockingDoubleTapGestureRecognizer
         || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer) {
 
-        if (hasAssistedNode(_assistedNodeInformation)) {
+        if (hasFocusedElement(_focusedElementInformation)) {
             // Request information about the position with sync message.
             // If the assisted node is the same, prevent the gesture.
             if (![self ensurePositionInformationIsUpToDate:WebKit::InteractionInformationRequest(WebCore::roundedIntPoint(point))])
                 return NO;
-            if (_positionInformation.nodeAtPositionIsAssistedNode)
+            if (_positionInformation.nodeAtPositionIsFocusedElement)
                 return NO;
         }
     }
 
     if (gestureRecognizer == _highlightLongPressGestureRecognizer) {
-        if (hasAssistedNode(_assistedNodeInformation)) {
+        if (hasFocusedElement(_focusedElementInformation)) {
             // This is a different node than the assisted one.
             // Prevent the gesture if there is no node.
             // Allow the gesture if it is a node that wants highlight or if there is an action for it.
@@ -1770,9 +1770,9 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
         if (![self ensurePositionInformationIsUpToDate:request])
             return NO;
 
-        if (hasAssistedNode(_assistedNodeInformation)) {
+        if (hasFocusedElement(_focusedElementInformation)) {
             // Prevent the gesture if it is the same node.
-            if (_positionInformation.nodeAtPositionIsAssistedNode)
+            if (_positionInformation.nodeAtPositionIsFocusedElement)
                 return NO;
         } else {
             // Prevent the gesture if there is no action for the node.
@@ -1877,8 +1877,8 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
 #endif
 
     // If we're currently editing an assisted node, only allow the selection to move within that assisted node.
-    if (self.isAssistingNode)
-        return _positionInformation.nodeAtPositionIsAssistedNode;
+    if (self.isFocusingElement)
+        return _positionInformation.nodeAtPositionIsFocusedElement;
     
     // Don't allow double tap text gestures in noneditable content.
     if (gesture == UIWKGestureDoubleTap)
@@ -2141,7 +2141,7 @@ static void cancelPotentialTapIfNecessary(WKContentView* contentView)
 
 - (void)clearSelection
 {
-    [self _stopAssistingNode];
+    [self _elementDidBlur];
     _page->clearSelection();
 }
 
@@ -2198,10 +2198,10 @@ static void cancelPotentialTapIfNecessary(WKContentView* contentView)
     if ([_formInputSession customInputAccessoryView])
         return YES;
 
-    if (_assistedNodeInformation.inputMode == WebCore::InputMode::None)
+    if (_focusedElementInformation.inputMode == WebCore::InputMode::None)
         return NO;
 
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::None:
     case WebKit::InputType::Drawing:
         return NO;
@@ -2546,9 +2546,9 @@ WEBCORE_COMMAND_FOR_WEBVIEW(pasteAndMatchStyle);
 - (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender
 {
     if (action == @selector(_nextAccessoryTab:))
-        return hasAssistedNode(_assistedNodeInformation) && _assistedNodeInformation.hasNextNode;
+        return hasFocusedElement(_focusedElementInformation) && _focusedElementInformation.hasNextNode;
     if (action == @selector(_previousAccessoryTab:))
-        return hasAssistedNode(_assistedNodeInformation) && _assistedNodeInformation.hasPreviousNode;
+        return hasFocusedElement(_focusedElementInformation) && _focusedElementInformation.hasPreviousNode;
 
     auto editorState = _page->editorState();
     if (action == @selector(_showTextStyleOptions:))
@@ -3055,9 +3055,9 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((WebKit::SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
 }
 
-- (BOOL)_isInteractingWithAssistedNode
+- (BOOL)_isInteractingWithFocusedElement
 {
-    return hasAssistedNode(_assistedNodeInformation);
+    return hasFocusedElement(_focusedElementInformation);
 }
 
 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state
@@ -3068,7 +3068,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state withFlags:(UIWKSelectionFlags)flags
 {
     _usingGestureForSelection = YES;
-    _page->selectWithGesture(WebCore::IntPoint(point), WebCore::CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), [self _isInteractingWithAssistedNode], [self, state, flags](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t innerFlags, WebKit::CallbackBase::Error error) {
+    _page->selectWithGesture(WebCore::IntPoint(point), WebCore::CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), [self _isInteractingWithFocusedElement], [self, state, flags](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t innerFlags, WebKit::CallbackBase::Error error) {
         selectionChangedWithGesture(self, point, gestureType, gestureState, flags | innerFlags, error);
         if (state == UIGestureRecognizerStateEnded || state == UIGestureRecognizerStateCancelled)
             _usingGestureForSelection = NO;
@@ -3148,7 +3148,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
     RetainPtr<WKContentView> view = self;
     
-    _page->selectPositionAtPoint(WebCore::IntPoint(point), [self _isInteractingWithAssistedNode], [view, selectionHandler](WebKit::CallbackBase::Error error) {
+    _page->selectPositionAtPoint(WebCore::IntPoint(point), [self _isInteractingWithFocusedElement], [view, selectionHandler](WebKit::CallbackBase::Error error) {
         selectionHandler();
         view->_usingGestureForSelection = NO;
         [selectionHandler release];
@@ -3161,7 +3161,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
     RetainPtr<WKContentView> view = self;
     
-    _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), [self _isInteractingWithAssistedNode], [view, selectionHandler](WebKit::CallbackBase::Error error) {
+    _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), [self _isInteractingWithFocusedElement], [view, selectionHandler](WebKit::CallbackBase::Error error) {
         selectionHandler();
         view->_usingGestureForSelection = NO;
         [selectionHandler release];
@@ -3187,7 +3187,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
     RetainPtr<WKContentView> view = self;
 
-    _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), [self _isInteractingWithAssistedNode], [view, selectionHandler](WebKit::CallbackBase::Error error) {
+    _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), [self _isInteractingWithFocusedElement], [view, selectionHandler](WebKit::CallbackBase::Error error) {
         selectionHandler();
         view->_usingGestureForSelection = NO;
         [selectionHandler release];
@@ -3208,7 +3208,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 {
     UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy];
     
-    _page->updateSelectionWithExtentPoint(WebCore::IntPoint(point), [self _isInteractingWithAssistedNode], [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
+    _page->updateSelectionWithExtentPoint(WebCore::IntPoint(point), [self _isInteractingWithFocusedElement], [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
         selectionHandler(endIsMoving);
         [selectionHandler release];
     });
@@ -3218,7 +3218,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 {
     UIWKSelectionWithDirectionCompletionHandler selectionHandler = [completionHandler copy];
     
-    _page->updateSelectionWithExtentPointAndBoundary(WebCore::IntPoint(point), toWKTextGranularity(granularity), [self _isInteractingWithAssistedNode], [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
+    _page->updateSelectionWithExtentPointAndBoundary(WebCore::IntPoint(point), toWKTextGranularity(granularity), [self _isInteractingWithFocusedElement], [selectionHandler](bool endIsMoving, WebKit::CallbackBase::Error error) {
         selectionHandler(endIsMoving);
         [selectionHandler release];
     });
@@ -3351,7 +3351,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     _isChangingFocusUsingAccessoryTab = YES;
     [self beginSelectionChange];
     RetainPtr<WKContentView> view = self;
-    _page->focusNextAssistedNode(isNext, [view](WebKit::CallbackBase::Error) {
+    _page->focusNextFocusedElement(isNext, [view](WebKit::CallbackBase::Error) {
         [view endSelectionChange];
         [view reloadInputViews];
         view->_isChangingFocusUsingAccessoryTab = NO;
@@ -3363,7 +3363,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     auto completionHandlerCopy = Block_copy(completionHandler);
     RetainPtr<WKContentView> view = self;
     _page->setInitialFocus(selectingForward, false, WebKit::WebKeyboardEvent(), [view, completionHandlerCopy](WebKit::CallbackBase::Error) {
-        BOOL didBecomeFirstResponder = view->_assistedNodeInformation.elementType != WebKit::InputType::None && [view becomeFirstResponder];
+        BOOL didBecomeFirstResponder = view->_focusedElementInformation.elementType != WebKit::InputType::None && [view becomeFirstResponder];
         completionHandlerCopy(didBecomeFirstResponder);
         Block_release(completionHandlerCopy);
     });
@@ -3402,18 +3402,18 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 
 - (void)accessoryClear
 {
-    _page->setAssistedNodeValue(String());
+    _page->setFocusedElementValue(String());
 }
 
 - (void)_updateAccessory
 {
-    [_formAccessoryView setNextEnabled:_assistedNodeInformation.hasNextNode];
-    [_formAccessoryView setPreviousEnabled:_assistedNodeInformation.hasPreviousNode];
+    [_formAccessoryView setNextEnabled:_focusedElementInformation.hasNextNode];
+    [_formAccessoryView setPreviousEnabled:_focusedElementInformation.hasPreviousNode];
 
     if (currentUserInterfaceIdiomIsPad())
         [_formAccessoryView setClearVisible:NO];
     else {
-        switch (_assistedNodeInformation.elementType) {
+        switch (_focusedElementInformation.elementType) {
         case WebKit::InputType::Date:
         case WebKit::InputType::Month:
         case WebKit::InputType::DateTimeLocal:
@@ -3456,7 +3456,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     }
 #if ENABLE(DATALIST_ELEMENT)
     if ([textSuggestion isKindOfClass:[WKDataListTextSuggestion class]]) {
-        _page->setAssistedNodeValue([textSuggestion inputText]);
+        _page->setFocusedElementValue([textSuggestion inputText]);
         return;
     }
 #endif
@@ -3530,7 +3530,7 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
     if (range)
         return;
 #if !PLATFORM(IOSMAC)
-    if (!hasAssistedNode(_assistedNodeInformation))
+    if (!hasFocusedElement(_focusedElementInformation))
         return;
 #endif
     [self clearSelection];
@@ -3806,23 +3806,23 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     if (!_traits)
         _traits = adoptNS([[UITextInputTraits alloc] init]);
 
-    [_traits setSecureTextEntry:_assistedNodeInformation.elementType == WebKit::InputType::Password || [_formInputSession forceSecureTextEntry]];
-    [_traits setShortcutConversionType:_assistedNodeInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault];
+    [_traits setSecureTextEntry:_focusedElementInformation.elementType == WebKit::InputType::Password || [_formInputSession forceSecureTextEntry]];
+    [_traits setShortcutConversionType:_focusedElementInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault];
 
-    if (!_assistedNodeInformation.formAction.isEmpty())
-        [_traits setReturnKeyType:(_assistedNodeInformation.elementType == WebKit::InputType::Search) ? UIReturnKeySearch : UIReturnKeyGo];
+    if (!_focusedElementInformation.formAction.isEmpty())
+        [_traits setReturnKeyType:(_focusedElementInformation.elementType == WebKit::InputType::Search) ? UIReturnKeySearch : UIReturnKeyGo];
 
-    if (_assistedNodeInformation.elementType == WebKit::InputType::Password || _assistedNodeInformation.elementType == WebKit::InputType::Email || _assistedNodeInformation.elementType == WebKit::InputType::URL || _assistedNodeInformation.formAction.contains("login")) {
+    if (_focusedElementInformation.elementType == WebKit::InputType::Password || _focusedElementInformation.elementType == WebKit::InputType::Email || _focusedElementInformation.elementType == WebKit::InputType::URL || _focusedElementInformation.formAction.contains("login")) {
         [_traits setAutocapitalizationType:UITextAutocapitalizationTypeNone];
         [_traits setAutocorrectionType:UITextAutocorrectionTypeNo];
     } else {
-        [_traits setAutocapitalizationType:toUITextAutocapitalize(_assistedNodeInformation.autocapitalizeType)];
-        [_traits setAutocorrectionType:_assistedNodeInformation.isAutocorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo];
+        [_traits setAutocapitalizationType:toUITextAutocapitalize(_focusedElementInformation.autocapitalizeType)];
+        [_traits setAutocorrectionType:_focusedElementInformation.isAutocorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo];
     }
 
-    switch (_assistedNodeInformation.inputMode) {
+    switch (_focusedElementInformation.inputMode) {
     case WebCore::InputMode::Unspecified:
-        switch (_assistedNodeInformation.elementType) {
+        switch (_focusedElementInformation.elementType) {
         case WebKit::InputType::Phone:
             [_traits setKeyboardType:UIKeyboardTypePhonePad];
             break;
@@ -3883,7 +3883,7 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
         break;
     }
 
-    [_traits setTextContentType:contentTypeFromFieldName(_assistedNodeInformation.autofillFieldName)];
+    [_traits setTextContentType:contentTypeFromFieldName(_focusedElementInformation.autofillFieldName)];
 
     [self _updateInteractionTintColor];
 
@@ -4082,7 +4082,7 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     if (_page->editorState().isContentEditable)
         return NO;
 
-    if (_assistedNodeInformation.elementType == WebKit::InputType::Select)
+    if (_focusedElementInformation.elementType == WebKit::InputType::Select)
         return NO;
 
     return YES;
@@ -4351,14 +4351,14 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     [_textSelectionAssistant deactivateSelection];
 }
 
-- (const WebKit::AssistedNodeInformation&)assistedNodeInformation
+- (const WebKit::FocusedElementInformation&)focusedElementInformation
 {
-    return _assistedNodeInformation;
+    return _focusedElementInformation;
 }
 
-- (Vector<WebKit::OptionItem>&)assistedNodeSelectOptions
+- (Vector<WebKit::OptionItem>&)focusedSelectElementOptions
 {
-    return _assistedNodeInformation.selectOptions;
+    return _focusedElementInformation.selectOptions;
 }
 
 - (UIWebFormAccessory *)formAccessoryView
@@ -4386,7 +4386,7 @@ static bool shouldZoomToRevealSelectionRect(WebKit::InputType type)
     }
 }
 
-static WebCore::FloatRect rectToRevealWhenZoomingToFocusedElement(const WebKit::AssistedNodeInformation& elementInfo, const WebKit::EditorState& editorState)
+static WebCore::FloatRect rectToRevealWhenZoomingToFocusedElement(const WebKit::FocusedElementInformation& elementInfo, const WebKit::EditorState& editorState)
 {
     WebCore::IntRect elementInteractionRect(elementInfo.elementInteractionLocation, { 1, 1 });
     if (!shouldZoomToRevealSelectionRect(elementInfo.elementType))
@@ -4446,15 +4446,15 @@ static bool isAssistableInputType(WebKit::InputType type)
     return false;
 }
 
-- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject
+- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject
 {
-    SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasAssistedNode(_assistedNodeInformation) };
+    SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasFocusedElement(_focusedElementInformation) };
     _inputViewUpdateDeferrer = nullptr;
 
     _didAccessoryTabInitiateFocus = _isChangingFocusUsingAccessoryTab;
 
     id <_WKInputDelegate> inputDelegate = [_webView _inputDelegate];
-    RetainPtr<WKFocusedElementInfo> focusedElementInfo = adoptNS([[WKFocusedElementInfo alloc] initWithAssistedNodeInformation:information isUserInitiated:userIsInteracting userObject:userObject]);
+    RetainPtr<WKFocusedElementInfo> focusedElementInfo = adoptNS([[WKFocusedElementInfo alloc] initWithFocusedElementInformation:information isUserInitiated:userIsInteracting userObject:userObject]);
 
     BOOL shouldShowKeyboard = NO;
     _WKFocusStartsInputSessionPolicy startInputSessionPolicy = _WKFocusStartsInputSessionPolicyAuto;
@@ -4501,7 +4501,7 @@ static bool isAssistableInputType(WebKit::InputType type)
     }
 
     if (blurPreviousNode)
-        [self _stopAssistingNode];
+        [self _elementDidBlur];
 
 #if HAVE(PENCILKIT)
     if (information.elementType == WebKit::InputType::Drawing)
@@ -4514,9 +4514,9 @@ static bool isAssistableInputType(WebKit::InputType type)
     if (!isAssistableInputType(information.elementType))
         return;
 
-    // FIXME: We should remove this check when we manage to send StartAssistingNode from the WebProcess
+    // FIXME: We should remove this check when we manage to send ElementDidFocus from the WebProcess
     // only when it is truly time to show the keyboard.
-    if (_assistedNodeInformation.elementType == information.elementType && _assistedNodeInformation.elementRect == information.elementRect)
+    if (_focusedElementInformation.elementType == information.elementType && _focusedElementInformation.elementRect == information.elementRect)
         return;
 
     [_webView _resetFocusPreservationCount];
@@ -4537,7 +4537,7 @@ static bool isAssistableInputType(WebKit::InputType type)
         [inputDelegate _webView:_webView willStartInputSession:_formInputSession.get()];
 
     BOOL editableChanged = [self setIsEditable:YES];
-    _assistedNodeInformation = information;
+    _focusedElementInformation = information;
     _inputPeripheral = nil;
     _traits = nil;
 
@@ -4547,7 +4547,7 @@ static bool isAssistableInputType(WebKit::InputType type)
 #if PLATFORM(WATCHOS)
     [self addFocusedFormControlOverlay];
     if (!_isChangingFocus)
-        [self presentViewControllerForCurrentAssistedNode];
+        [self presentViewControllerForCurrentFocusedElement];
 #else
     [self reloadInputViews];
 #endif
@@ -4568,11 +4568,11 @@ static bool isAssistableInputType(WebKit::InputType type)
         break;
     }
     
-    // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects.
+    // The custom fixed position rect behavior is affected by -isFocusingElement, so if that changes we need to recompute rects.
     if (editableChanged)
         [_webView _scheduleVisibleContentRectUpdate];
     
-    if (!shouldZoomToRevealSelectionRect(_assistedNodeInformation.elementType))
+    if (!shouldZoomToRevealSelectionRect(_focusedElementInformation.elementType))
         [self _zoomToRevealFocusedElement];
 
     [self _ensureFormAccessoryView];
@@ -4592,7 +4592,7 @@ static bool isAssistableInputType(WebKit::InputType type)
     [_webView didStartFormControlInteraction];
 }
 
-- (void)_stopAssistingNode
+- (void)_elementDidBlur
 {
     SetForScope<BOOL> isBlurringFocusedNodeForScope { _isBlurringFocusedNode, YES };
 
@@ -4611,7 +4611,7 @@ static bool isAssistableInputType(WebKit::InputType type)
 
     BOOL editableChanged = [self setIsEditable:NO];
 
-    _assistedNodeInformation.elementType = WebKit::InputType::None;
+    _focusedElementInformation.elementType = WebKit::InputType::None;
     _inputPeripheral = nil;
     _focusRequiresStrongPasswordAssistance = NO;
 
@@ -4626,7 +4626,7 @@ static bool isAssistableInputType(WebKit::InputType type)
         [self removeFocusedFormControlOverlay];
 #endif
 
-    // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects.
+    // The custom fixed position rect behavior is affected by -isFocusingElement, so if that changes we need to recompute rects.
     if (editableChanged)
         [_webView _scheduleVisibleContentRectUpdate];
 
@@ -4644,7 +4644,7 @@ static bool isAssistableInputType(WebKit::InputType type)
 
     // FIXME: If the initial writing direction just changed, we should wait until we get the next post-layout editor state
     // before zooming to reveal the selection rect.
-    if (shouldZoomToRevealSelectionRect(_assistedNodeInformation.elementType))
+    if (shouldZoomToRevealSelectionRect(_focusedElementInformation.elementType))
         [self _zoomToRevealFocusedElement];
 }
 
@@ -4665,18 +4665,18 @@ static bool isAssistableInputType(WebKit::InputType type)
     [keyboard setInitialDirection];
 }
 
-- (void)updateCurrentAssistedNodeInformation:(Function<void(bool didUpdate)>&&)callback
+- (void)updateCurrentFocusedElementInformation:(Function<void(bool didUpdate)>&&)callback
 {
     WeakObjCPtr<WKContentView> weakSelf { self };
-    auto identifierBeforeUpdate = _assistedNodeInformation.assistedNodeIdentifier;
-    _page->requestAssistedNodeInformation([callback = WTFMove(callback), identifierBeforeUpdate, weakSelf] (auto& info, auto error) {
-        if (!weakSelf || error != WebKit::CallbackBase::Error::None || info.assistedNodeIdentifier != identifierBeforeUpdate) {
+    auto identifierBeforeUpdate = _focusedElementInformation.focusedElementIdentifier;
+    _page->requestFocusedElementInformation([callback = WTFMove(callback), identifierBeforeUpdate, weakSelf] (auto& info, auto error) {
+        if (!weakSelf || error != WebKit::CallbackBase::Error::None || info.focusedElementIdentifier != identifierBeforeUpdate) {
             // If the assisted node may have changed in the meantime, don't overwrite assisted node information.
             callback(false);
             return;
         }
 
-        weakSelf.get()->_assistedNodeInformation = info;
+        weakSelf.get()->_focusedElementInformation = info;
         callback(true);
     });
 }
@@ -4717,7 +4717,7 @@ static bool isAssistableInputType(WebKit::InputType type)
     [self setInputDelegate:nil];
 }
 
-- (void)presentViewControllerForCurrentAssistedNode
+- (void)presentViewControllerForCurrentFocusedElement
 {
     [self dismissAllInputViewControllers:NO];
 
@@ -4728,7 +4728,7 @@ static bool isAssistableInputType(WebKit::InputType type)
 
     BOOL prefersModalPresentation = NO;
 
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::Select:
         _presentedFullScreenInputViewController = adoptNS([[WKSelectMenuListViewController alloc] initWithDelegate:self]);
         break;
@@ -4808,45 +4808,45 @@ static bool isAssistableInputType(WebKit::InputType type)
 - (void)focusedFormControlViewDidSubmit:(WKFocusedFormControlView *)view
 {
     [self insertText:@"\n"];
-    _page->blurAssistedNode();
+    _page->blurFocusedElement();
 }
 
 - (void)focusedFormControlViewDidCancel:(WKFocusedFormControlView *)view
 {
-    _page->blurAssistedNode();
+    _page->blurFocusedElement();
 }
 
 - (void)focusedFormControlViewDidBeginEditing:(WKFocusedFormControlView *)view
 {
-    [self updateCurrentAssistedNodeInformation:[weakSelf = WeakObjCPtr<WKContentView>(self)] (bool didUpdate) {
+    [self updateCurrentFocusedElementInformation:[weakSelf = WeakObjCPtr<WKContentView>(self)] (bool didUpdate) {
         if (!didUpdate)
             return;
 
         auto strongSelf = weakSelf.get();
-        [strongSelf presentViewControllerForCurrentAssistedNode];
+        [strongSelf presentViewControllerForCurrentFocusedElement];
         [strongSelf->_focusedFormControlView hide:YES];
     }];
 }
 
 - (CGRect)rectForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    return [self convertRect:_assistedNodeInformation.elementRect toView:view];
+    return [self convertRect:_focusedElementInformation.elementRect toView:view];
 }
 
 - (CGRect)nextRectForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    if (!_assistedNodeInformation.hasNextNode)
+    if (!_focusedElementInformation.hasNextNode)
         return CGRectNull;
 
-    return [self convertRect:_assistedNodeInformation.nextNodeRect toView:view];
+    return [self convertRect:_focusedElementInformation.nextNodeRect toView:view];
 }
 
 - (CGRect)previousRectForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    if (!_assistedNodeInformation.hasPreviousNode)
+    if (!_focusedElementInformation.hasPreviousNode)
         return CGRectNull;
 
-    return [self convertRect:_assistedNodeInformation.previousNodeRect toView:view];
+    return [self convertRect:_focusedElementInformation.previousNodeRect toView:view];
 }
 
 - (UIScrollView *)scrollViewForFocusedFormControlView:(WKFocusedFormControlView *)view
@@ -4856,10 +4856,10 @@ static bool isAssistableInputType(WebKit::InputType type)
 
 - (NSString *)actionNameForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    if (_assistedNodeInformation.formAction.isEmpty())
+    if (_focusedElementInformation.formAction.isEmpty())
         return nil;
 
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::Select:
     case WebKit::InputType::Time:
     case WebKit::InputType::Date:
@@ -4876,24 +4876,24 @@ static bool isAssistableInputType(WebKit::InputType type)
 
 - (void)focusedFormControlViewDidRequestNextNode:(WKFocusedFormControlView *)view
 {
-    if (_assistedNodeInformation.hasNextNode)
-        _page->focusNextAssistedNode(true);
+    if (_focusedElementInformation.hasNextNode)
+        _page->focusNextFocusedElement(true);
 }
 
 - (void)focusedFormControlViewDidRequestPreviousNode:(WKFocusedFormControlView *)view
 {
-    if (_assistedNodeInformation.hasPreviousNode)
-        _page->focusNextAssistedNode(false);
+    if (_focusedElementInformation.hasPreviousNode)
+        _page->focusNextFocusedElement(false);
 }
 
 - (BOOL)hasNextNodeForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    return _assistedNodeInformation.hasNextNode;
+    return _focusedElementInformation.hasNextNode;
 }
 
 - (BOOL)hasPreviousNodeForFocusedFormControlView:(WKFocusedFormControlView *)view
 {
-    return _assistedNodeInformation.hasPreviousNode;
+    return _focusedElementInformation.hasPreviousNode;
 }
 
 - (void)focusedFormControllerDidUpdateSuggestions:(WKFocusedFormControlView *)view
@@ -4908,18 +4908,18 @@ static bool isAssistableInputType(WebKit::InputType type)
 
 - (void)selectMenu:(WKSelectMenuListViewController *)selectMenu didSelectItemAtIndex:(NSUInteger)index
 {
-    ASSERT(!_assistedNodeInformation.isMultiSelect);
-    _page->setAssistedNodeSelectedIndex(index, false);
+    ASSERT(!_focusedElementInformation.isMultiSelect);
+    _page->setFocusedElementSelectedIndex(index, false);
 }
 
 - (NSUInteger)numberOfItemsInSelectMenu:(WKSelectMenuListViewController *)selectMenu
 {
-    return self.assistedNodeSelectOptions.size();
+    return self.focusedSelectElementOptions.size();
 }
 
 - (NSString *)selectMenu:(WKSelectMenuListViewController *)selectMenu displayTextForItemAtIndex:(NSUInteger)index
 {
-    auto& options = self.assistedNodeSelectOptions;
+    auto& options = self.focusedSelectElementOptions;
     if (index >= options.size()) {
         ASSERT_NOT_REACHED();
         return @"";
@@ -4930,35 +4930,35 @@ static bool isAssistableInputType(WebKit::InputType type)
 
 - (void)selectMenu:(WKSelectMenuListViewController *)selectMenu didCheckItemAtIndex:(NSUInteger)index checked:(BOOL)checked
 {
-    ASSERT(_assistedNodeInformation.isMultiSelect);
-    if (index >= self.assistedNodeSelectOptions.size()) {
+    ASSERT(_focusedElementInformation.isMultiSelect);
+    if (index >= self.focusedSelectElementOptions.size()) {
         ASSERT_NOT_REACHED();
         return;
     }
 
-    auto& option = self.assistedNodeSelectOptions[index];
+    auto& option = self.focusedSelectElementOptions[index];
     if (option.isSelected == checked) {
         ASSERT_NOT_REACHED();
         return;
     }
 
-    _page->setAssistedNodeSelectedIndex(index, true);
+    _page->setFocusedElementSelectedIndex(index, true);
     option.isSelected = checked;
 }
 
 - (BOOL)selectMenuUsesMultipleSelection:(WKSelectMenuListViewController *)selectMenu
 {
-    return _assistedNodeInformation.isMultiSelect;
+    return _focusedElementInformation.isMultiSelect;
 }
 
 - (BOOL)selectMenu:(WKSelectMenuListViewController *)selectMenu hasSelectedOptionAtIndex:(NSUInteger)index
 {
-    if (index >= self.assistedNodeSelectOptions.size()) {
+    if (index >= self.focusedSelectElementOptions.size()) {
         ASSERT_NOT_REACHED();
         return NO;
     }
 
-    return self.assistedNodeSelectOptions[index].isSelected;
+    return self.focusedSelectElementOptions[index].isSelected;
 }
 
 #endif // PLATFORM(WATCHOS)
@@ -5000,7 +5000,7 @@ static bool isAssistableInputType(WebKit::InputType type)
         return;
 
     auto& postLayoutData = state.postLayoutData();
-    if (hasAssistedNode(_assistedNodeInformation)) {
+    if (hasFocusedElement(_focusedElementInformation)) {
         if (postLayoutData.elementIsTransparent)
             [self _beginSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTransparent];
         else
@@ -5744,14 +5744,14 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (NSDictionary *)_autofillContext
 {
-    BOOL provideStrongPasswordAssistance = _focusRequiresStrongPasswordAssistance && _assistedNodeInformation.elementType == WebKit::InputType::Password;
-    if (!hasAssistedNode(_assistedNodeInformation) || (!_assistedNodeInformation.acceptsAutofilledLoginCredentials && !provideStrongPasswordAssistance))
+    BOOL provideStrongPasswordAssistance = _focusRequiresStrongPasswordAssistance && _focusedElementInformation.elementType == WebKit::InputType::Password;
+    if (!hasFocusedElement(_focusedElementInformation) || (!_focusedElementInformation.acceptsAutofilledLoginCredentials && !provideStrongPasswordAssistance))
         return nil;
 
     if (provideStrongPasswordAssistance)
         return @{ @"_automaticPasswordKeyboard" : @YES };
 
-    NSURL *platformURL = _assistedNodeInformation.representingPageURL;
+    NSURL *platformURL = _focusedElementInformation.representingPageURL;
     if (platformURL)
         return @{ @"_WebViewURL" : platformURL };
 
@@ -6094,12 +6094,12 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
     BOOL shouldRevealFocusOverlay = NO;
     // In the case where there's nothing the user could potentially do besides dismiss the overlay, we can just automatically without asking the delegate.
     if ([_webView._inputDelegate respondsToSelector:@selector(_webView:shouldRevealFocusOverlayForInputSession:)]
-        && ([self actionNameForFocusedFormControlView:_focusedFormControlView.get()] || _assistedNodeInformation.hasNextNode || _assistedNodeInformation.hasPreviousNode))
+        && ([self actionNameForFocusedFormControlView:_focusedFormControlView.get()] || _focusedElementInformation.hasNextNode || _focusedElementInformation.hasPreviousNode))
         shouldRevealFocusOverlay = [_webView._inputDelegate _webView:_webView shouldRevealFocusOverlayForInputSession:_formInputSession.get()];
 
     if (shouldRevealFocusOverlay) {
         [_focusedFormControlView show:NO];
-        [self updateCurrentAssistedNodeInformation:[weakSelf = WeakObjCPtr<WKContentView>(self)] (bool didUpdate) {
+        [self updateCurrentFocusedElementInformation:[weakSelf = WeakObjCPtr<WKContentView>(self)] (bool didUpdate) {
             if (!didUpdate)
                 return;
 
@@ -6108,7 +6108,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
             [focusedFormController engageFocusedFormControlNavigation];
         }];
     } else
-        _page->blurAssistedNode();
+        _page->blurFocusedElement();
 
     // The Quickboard view controller passed into this delegate method is not necessarily the view controller we originally presented;
     // this happens in the case when the user chooses an input method (e.g. scribble) and a new Quickboard view controller is presented.
@@ -6146,7 +6146,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (BOOL)allowsLanguageSelectionMenuForListViewController:(PUICQuickboardViewController *)controller
 {
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::ContentEditable:
     case WebKit::InputType::Text:
     case WebKit::InputType::TextArea:
@@ -6170,26 +6170,26 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (NSString *)inputLabelTextForViewController:(PUICQuickboardViewController *)controller
 {
-    if (!_assistedNodeInformation.label.isEmpty())
-        return _assistedNodeInformation.label;
+    if (!_focusedElementInformation.label.isEmpty())
+        return _focusedElementInformation.label;
 
-    if (!_assistedNodeInformation.ariaLabel.isEmpty())
-        return _assistedNodeInformation.ariaLabel;
+    if (!_focusedElementInformation.ariaLabel.isEmpty())
+        return _focusedElementInformation.ariaLabel;
 
-    if (!_assistedNodeInformation.title.isEmpty())
-        return _assistedNodeInformation.title;
+    if (!_focusedElementInformation.title.isEmpty())
+        return _focusedElementInformation.title;
 
-    return _assistedNodeInformation.placeholder;
+    return _focusedElementInformation.placeholder;
 }
 
 - (NSString *)initialValueForViewController:(PUICQuickboardViewController *)controller
 {
-    return _assistedNodeInformation.value;
+    return _focusedElementInformation.value;
 }
 
 - (BOOL)shouldDisplayInputContextViewForListViewController:(PUICQuickboardViewController *)controller
 {
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::ContentEditable:
     case WebKit::InputType::Text:
     case WebKit::InputType::Password:
@@ -6208,7 +6208,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (WKNumberPadInputMode)numericInputModeForListViewController:(WKTextInputListViewController *)controller
 {
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::Phone:
         return WKNumberPadInputModeTelephone;
     case WebKit::InputType::Number:
@@ -6222,7 +6222,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (NSString *)textContentTypeForListViewController:(WKTextInputListViewController *)controller
 {
-    switch (_assistedNodeInformation.elementType) {
+    switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::Password:
         return UITextContentTypePassword;
     case WebKit::InputType::URL:
@@ -6233,10 +6233,10 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
         return UITextContentTypeTelephoneNumber;
     default:
         // The element type alone is insufficient to infer content type; fall back to autofill data.
-        if (NSString *contentType = contentTypeFromFieldName(_assistedNodeInformation.autofillFieldName))
+        if (NSString *contentType = contentTypeFromFieldName(_focusedElementInformation.autofillFieldName))
             return contentType;
 
-        if (_assistedNodeInformation.isAutofillableUsernameField)
+        if (_focusedElementInformation.isAutofillableUsernameField)
             return UITextContentTypeUsername;
 
         return nil;
@@ -6256,7 +6256,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
 
 - (BOOL)allowsDictationInputForListViewController:(PUICQuickboardViewController *)controller
 {
-    return _assistedNodeInformation.elementType != WebKit::InputType::Password;
+    return _focusedElementInformation.elementType != WebKit::InputType::Password;
 }
 
 #endif // PLATFORM(WATCHOS)
index 6f07d89..7b38833 100644 (file)
@@ -190,7 +190,7 @@ void WebDataListSuggestionsDropdownIOS::didSelectOption(const String& selectedOp
 
 - (NSTextAlignment)textAlignment
 {
-    return _view.assistedNodeInformation.isRTL ? NSTextAlignmentRight : NSTextAlignmentLeft;
+    return _view.focusedElementInformation.isRTL ? NSTextAlignmentRight : NSTextAlignmentLeft;
 }
 
 @end
index 68aa2b1..f6d304b 100644 (file)
@@ -187,9 +187,9 @@ void WebPageProxy::selectionRectsCallback(const Vector<WebCore::SelectionRect>&
     callback->performCallbackWithReturnValue(selectionRects);
 }
 
-void WebPageProxy::assistedNodeInformationCallback(const AssistedNodeInformation& info, CallbackID callbackID)
+void WebPageProxy::focusedElementInformationCallback(const FocusedElementInformation& info, CallbackID callbackID)
 {
-    auto callback = m_callbacks.take<AssistedNodeInformationCallback>(callbackID);
+    auto callback = m_callbacks.take<FocusedElementInformationCallback>(callbackID);
     if (!callback) {
         ASSERT_NOT_REACHED();
         return;
@@ -198,7 +198,7 @@ void WebPageProxy::assistedNodeInformationCallback(const AssistedNodeInformation
     callback->performCallbackWithReturnValue(info);
 }
 
-void WebPageProxy::requestAssistedNodeInformation(Function<void(const AssistedNodeInformation&, CallbackBase::Error)>&& callback)
+void WebPageProxy::requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&& callback)
 {
     if (!isValid()) {
         callback({ }, CallbackBase::Error::OwnerWasInvalidated);
@@ -206,7 +206,7 @@ void WebPageProxy::requestAssistedNodeInformation(Function<void(const AssistedNo
     }
 
     auto callbackID = m_callbacks.put(WTFMove(callback), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::RequestAssistedNodeInformation(callbackID), m_pageID);
+    m_process->send(Messages::WebPage::RequestFocusedElementInformation(callbackID), m_pageID);
 }
 
 void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdate)
@@ -248,7 +248,7 @@ WebCore::FloatRect WebPageProxy::computeCustomFixedPositionRect(const FloatRect&
     FloatRect constrainedUnobscuredRect = unobscuredContentRect;
     FloatRect documentRect = pageClient().documentRect();
 
-    if (!visualViewportEnabled && pageClient().isAssistingNode())
+    if (!visualViewportEnabled && pageClient().isFocusingElement())
         return documentRect;
 
     if (constraint == FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect)
@@ -381,11 +381,8 @@ void WebPageProxy::didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&
         didReachLayoutMilestone(WebCore::ReachedSessionRestorationRenderTreeSizeThreshold);
     }
 
-    if (m_deferredNodeAssistanceArguments) {
-        pageClient().startAssistingNode(m_deferredNodeAssistanceArguments->m_nodeInformation, m_deferredNodeAssistanceArguments->m_userIsInteracting, m_deferredNodeAssistanceArguments->m_blurPreviousNode,
-            m_deferredNodeAssistanceArguments->m_changingActivityState, m_deferredNodeAssistanceArguments->m_userData.get());
-        m_deferredNodeAssistanceArguments = nullptr;
-    }
+    if (auto arguments = std::exchange(m_deferredElementDidFocusArguments, nullptr))
+        pageClient().elementDidFocus(arguments->information, arguments->userIsInteracting, arguments->blurPreviousNode, arguments->changingActivityState, arguments->userData.get());
 }
 
 bool WebPageProxy::updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction& layerTreeTransaction)
@@ -409,7 +406,7 @@ void WebPageProxy::layerTreeCommitComplete()
     pageClient().layerTreeCommitComplete();
 }
 
-void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::TextGranularity granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::TextGranularity granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WTF::Function<void(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(WebCore::IntPoint(), 0, 0, 0, CallbackBase::Error::Unknown);
@@ -417,7 +414,7 @@ void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::Tex
     }
 
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::SelectWithGesture(point, (uint32_t)granularity, gestureType, gestureState, isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::SelectWithGesture(point, (uint32_t)granularity, gestureType, gestureState, isInteractingWithFocusedElement, callbackID), m_pageID);
 }
 
 void WebPageProxy::updateSelectionWithTouches(const WebCore::IntPoint point, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&& callbackFunction)
@@ -470,7 +467,7 @@ bool WebPageProxy::applyAutocorrection(const String& correction, const String& o
     return autocorrectionApplied;
 }
 
-void WebPageProxy::selectTextWithGranularityAtPoint(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::selectTextWithGranularityAtPoint(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(CallbackBase::Error::Unknown);
@@ -478,10 +475,10 @@ void WebPageProxy::selectTextWithGranularityAtPoint(const WebCore::IntPoint poin
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::SelectTextWithGranularityAtPoint(point, static_cast<uint32_t>(granularity), isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::SelectTextWithGranularityAtPoint(point, static_cast<uint32_t>(granularity), isInteractingWithFocusedElement, callbackID), m_pageID);
 }
 
-void WebPageProxy::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint point, WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint point, WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(CallbackBase::Error::Unknown);
@@ -489,7 +486,7 @@ void WebPageProxy::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::SelectPositionAtBoundaryWithDirection(point, static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::SelectPositionAtBoundaryWithDirection(point, static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), isInteractingWithFocusedElement, callbackID), m_pageID);
 }
 
 void WebPageProxy::moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
@@ -503,7 +500,7 @@ void WebPageProxy::moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity
     m_process->send(Messages::WebPage::MoveSelectionAtBoundaryWithDirection(static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), callbackID), m_pageID);
 }
     
-void WebPageProxy::selectPositionAtPoint(const WebCore::IntPoint point, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::selectPositionAtPoint(const WebCore::IntPoint point, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(CallbackBase::Error::Unknown);
@@ -511,7 +508,7 @@ void WebPageProxy::selectPositionAtPoint(const WebCore::IntPoint point, bool isI
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::SelectPositionAtPoint(point, isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::SelectPositionAtPoint(point, isInteractingWithFocusedElement, callbackID), m_pageID);
 }
 
 void WebPageProxy::beginSelectionInDirection(WebCore::SelectionDirection direction, WTF::Function<void (uint64_t, CallbackBase::Error)>&& callbackFunction)
@@ -525,7 +522,7 @@ void WebPageProxy::beginSelectionInDirection(WebCore::SelectionDirection directi
     m_process->send(Messages::WebPage::BeginSelectionInDirection(direction, callbackID), m_pageID);
 }
 
-void WebPageProxy::updateSelectionWithExtentPoint(const WebCore::IntPoint point, bool isInteractingWithAssistedNode, WTF::Function<void (uint64_t, CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::updateSelectionWithExtentPoint(const WebCore::IntPoint point, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(0, CallbackBase::Error::Unknown);
@@ -533,11 +530,11 @@ void WebPageProxy::updateSelectionWithExtentPoint(const WebCore::IntPoint point,
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::UpdateSelectionWithExtentPoint(point, isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::UpdateSelectionWithExtentPoint(point, isInteractingWithFocusedElement, callbackID), m_pageID);
     
 }
 
-void WebPageProxy::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithAssistedNode, WTF::Function<void(uint64_t, CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(0, CallbackBase::Error::Unknown);
@@ -545,7 +542,7 @@ void WebPageProxy::updateSelectionWithExtentPointAndBoundary(const WebCore::IntP
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    m_process->send(Messages::WebPage::UpdateSelectionWithExtentPointAndBoundary(point, granularity, isInteractingWithAssistedNode, callbackID), m_pageID);
+    m_process->send(Messages::WebPage::UpdateSelectionWithExtentPointAndBoundary(point, granularity, isInteractingWithFocusedElement, callbackID), m_pageID);
     
 }
 
@@ -848,9 +845,9 @@ void WebPageProxy::inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&
     process().send(Messages::WebPage::InspectorNodeSearchEndedAtPosition(position), m_pageID);
 }
 
-void WebPageProxy::blurAssistedNode()
+void WebPageProxy::blurFocusedElement()
 {
-    process().send(Messages::WebPage::BlurAssistedNode(), m_pageID);
+    process().send(Messages::WebPage::BlurFocusedElement(), m_pageID);
 }
 
 FloatSize WebPageProxy::screenSize()
@@ -893,24 +890,25 @@ void WebPageProxy::didGetTapHighlightGeometries(uint64_t requestID, const WebCor
     pageClient().didGetTapHighlightGeometries(requestID, color, highlightedQuads, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
 }
 
-void WebPageProxy::startAssistingNode(const AssistedNodeInformation& information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData& userData)
+void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData& userData)
 {
     m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = true;
 
     API::Object* userDataObject = process().transformHandlesToObjects(userData.object()).get();
     if (m_editorState.isMissingPostLayoutData) {
-        m_deferredNodeAssistanceArguments = std::make_unique<NodeAssistanceArguments>(NodeAssistanceArguments { information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject });
+        // FIXME: We should try to eliminate m_deferredElementDidFocusArguments altogether, in favor of only deferring actions that are dependent on post-layout editor state information.
+        m_deferredElementDidFocusArguments = std::make_unique<ElementDidFocusArguments>(ElementDidFocusArguments { information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject });
         return;
     }
 
-    pageClient().startAssistingNode(information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject);
+    pageClient().elementDidFocus(information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject);
 }
 
-void WebPageProxy::stopAssistingNode()
+void WebPageProxy::elementDidBlur()
 {
     m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false;
-    m_deferredNodeAssistanceArguments = nullptr;
-    pageClient().stopAssistingNode();
+    m_deferredElementDidFocusArguments = nullptr;
+    pageClient().elementDidBlur();
 }
 
 void WebPageProxy::autofillLoginCredentials(const String& username, const String& password)
@@ -948,7 +946,7 @@ void WebPageProxy::disableInspectorNodeSearch()
     pageClient().disableInspectorNodeSearch();
 }
 
-void WebPageProxy::focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebPageProxy::focusNextFocusedElement(bool isForward, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
         callbackFunction(CallbackBase::Error::Unknown);
@@ -956,22 +954,22 @@ void WebPageProxy::focusNextAssistedNode(bool isForward, WTF::Function<void (Cal
     }
     
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
-    process().send(Messages::WebPage::FocusNextAssistedNode(isForward, callbackID), m_pageID);
+    process().send(Messages::WebPage::FocusNextFocusedElement(isForward, callbackID), m_pageID);
 }
 
-void WebPageProxy::setAssistedNodeValue(const String& value)
+void WebPageProxy::setFocusedElementValue(const String& value)
 {
-    process().send(Messages::WebPage::SetAssistedNodeValue(value), m_pageID);
+    process().send(Messages::WebPage::SetFocusedElementValue(value), m_pageID);
 }
 
-void WebPageProxy::setAssistedNodeValueAsNumber(double value)
+void WebPageProxy::setFocusedElementValueAsNumber(double value)
 {
-    process().send(Messages::WebPage::SetAssistedNodeValueAsNumber(value), m_pageID);
+    process().send(Messages::WebPage::SetFocusedElementValueAsNumber(value), m_pageID);
 }
 
-void WebPageProxy::setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection)
+void WebPageProxy::setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection)
 {
-    process().send(Messages::WebPage::SetAssistedNodeSelectedIndex(index, allowMultipleSelection), m_pageID);
+    process().send(Messages::WebPage::SetFocusedElementSelectedIndex(index, allowMultipleSelection), m_pageID);
 }
 
 void WebPageProxy::didPerformDictionaryLookup(const DictionaryPopupInfo&)
index 34b4f8d..daac90a 100644 (file)
@@ -28,7 +28,7 @@
 
 #if ENABLE(INPUT_TYPE_COLOR) && PLATFORM(IOS_FAMILY)
 
-#import "AssistedNodeInformation.h"
+#import "FocusedElementInformation.h"
 #import "UIKitSPI.h"
 #import "WKContentViewInteraction.h"
 #import "WKFormPopover.h"
@@ -196,11 +196,11 @@ using namespace WebKit;
     NSArray<NSArray<UIColor *> *> *topColorMatrix = [[self class] defaultTopColorMatrix];
 
 #if ENABLE(DATALIST_ELEMENT)
-    size_t numColorSuggestions = view.assistedNodeInformation.suggestedColors.size();
+    size_t numColorSuggestions = view.focusedElementInformation.suggestedColors.size();
     if (numColorSuggestions) {
         NSMutableArray<UIColor *> *colors = [NSMutableArray array];
         for (size_t i = 0; i < std::min(numColorSuggestions, maxColorSuggestions); i++) {
-            WebCore::Color color = view.assistedNodeInformation.suggestedColors[i];
+            WebCore::Color color = view.focusedElementInformation.suggestedColors[i];
             [colors addObject:[UIColor colorWithCGColor:cachedCGColor(color)]];
         }
         topColorMatrix = @[ colors ];
@@ -263,7 +263,7 @@ using namespace WebKit;
 - (void)setControlValueFromUIColor:(UIColor *)uiColor
 {
     WebCore::Color color(uiColor.CGColor);
-    [_view page]->setAssistedNodeValue(color.serialized());
+    [_view page]->setFocusedElementValue(color.serialized());
 }
 
 #pragma mark WKFormControl
index 2bb02ca..98e1467 100644 (file)
@@ -87,7 +87,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     _view = view;
     _shouldRemoveTimeZoneInformation = NO;
     _isTimeInput = NO;
-    switch (view.assistedNodeInformation.elementType) {
+    switch (view.focusedElementInformation.elementType) {
     case InputType::Date:
         _formatString = kDateFormatString;
         break;
@@ -111,7 +111,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     _datePicker.get().datePickerMode = mode;
     _datePicker.get().hidden = NO;
     
-    if ([self shouldPresentGregorianCalendar:view.assistedNodeInformation])
+    if ([self shouldPresentGregorianCalendar:view.focusedElementInformation])
         _datePicker.get().calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];
     
     [_datePicker addTarget:self action:@selector(_dateChangeHandler:) forControlEvents:UIControlEventValueChanged];
@@ -130,7 +130,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     [super dealloc];
 }
 
-- (BOOL)shouldPresentGregorianCalendar:(const AssistedNodeInformation&)nodeInfo
+- (BOOL)shouldPresentGregorianCalendar:(const FocusedElementInformation&)nodeInfo
 {
     return nodeInfo.autofillFieldName == WebCore::AutofillFieldName::CcExpMonth
         || nodeInfo.autofillFieldName == WebCore::AutofillFieldName::CcExp
@@ -163,7 +163,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
 - (void)_dateChangedSetAsNumber
 {
     NSDate *date = [_datePicker date];
-    [_view page]->setAssistedNodeValueAsNumber(([date timeIntervalSince1970] + [self _timeZoneOffsetFromGMT:date]) * kMillisecondsPerSecond);
+    [_view page]->setFocusedElementValueAsNumber(([date timeIntervalSince1970] + [self _timeZoneOffsetFromGMT:date]) * kMillisecondsPerSecond);
 }
 
 - (RetainPtr<NSDateFormatter>)dateFormatterForPicker
@@ -181,7 +181,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     // Force English locale because that is what HTML5 value parsing expects.
     RetainPtr<NSDateFormatter> dateFormatter = [self dateFormatterForPicker];
 
-    [_view page]->setAssistedNodeValue([dateFormatter stringFromDate:[_datePicker date]]);
+    [_view page]->setFocusedElementValue([dateFormatter stringFromDate:[_datePicker date]]);
 }
 
 - (void)_dateChanged
@@ -208,8 +208,8 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
 
     // Currently no value for the <input>. Start the picker with the current time.
     // Also, update the actual <input> value.
-    NSString *value = _view.assistedNodeInformation.value;
-    if (_view.assistedNodeInformation.value.isEmpty()) {
+    NSString *value = _view.focusedElementInformation.value;
+    if (_view.focusedElementInformation.value.isEmpty()) {
         [_datePicker setDate:[NSDate date]];
         [self _dateChanged];
         return;
@@ -225,7 +225,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     }
 
     // Convert the number value to a date object for the fields affected by timezones.
-    NSTimeInterval secondsSince1970 = _view.assistedNodeInformation.valueAsNumber / kMillisecondsPerSecond;
+    NSTimeInterval secondsSince1970 = _view.focusedElementInformation.valueAsNumber / kMillisecondsPerSecond;
     NSInteger timeZoneOffset = [self _timeZoneOffsetFromGMT:[NSDate dateWithTimeIntervalSince1970:secondsSince1970]];
     NSTimeInterval adjustedSecondsSince1970 = secondsSince1970 - timeZoneOffset;
     [_datePicker setDate:[NSDate dateWithTimeIntervalSince1970:adjustedSecondsSince1970]];
@@ -249,7 +249,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
 
     UIDatePickerMode mode;
 
-    switch (view.assistedNodeInformation.elementType) {
+    switch (view.focusedElementInformation.elementType) {
     case InputType::Date:
         mode = UIDatePickerModeDate;
         break;
@@ -334,7 +334,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
 
 - (void)clear:(id)sender
 {
-    [_view page]->setAssistedNodeValue(String());
+    [_view page]->setFocusedElementValue(String());
 }
 
 - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode
@@ -349,7 +349,7 @@ static const NSTimeInterval kMillisecondsPerSecond = 1000;
     CGFloat popoverHeight = _viewController.get().view.frame.size.height;
     [_viewController setPreferredContentSize:CGSizeMake(popoverWidth, popoverHeight)];
     [_viewController setEdgesForExtendedLayout:UIRectEdgeNone];
-    [_viewController setTitle:_view.assistedNodeInformation.title];
+    [_viewController setTitle:_view.focusedElementInformation.title];
 
     // Always have a navigation controller with a clear button, and a title if the input element has a title.
     RetainPtr<UINavigationController> navigationController = adoptNS([[UINavigationController alloc] initWithRootViewController:_viewController.get()]);
index 99ff72b..07eee03 100644 (file)
@@ -142,7 +142,7 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
                           permittedArrowDirections:directions
                                           animated:animated];
     } else {
-        CGRect boundingBoxOfDOMNode = _view.assistedNodeInformation.elementRect;
+        CGRect boundingBoxOfDOMNode = _view.focusedElementInformation.elementRect;
         [_popoverController presentPopoverFromRect:CGRectIntegral(boundingBoxOfDOMNode)
                                             inView:_view
                           permittedArrowDirections:directions
index 402520a..7be651a 100644 (file)
@@ -25,7 +25,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#import "AssistedNodeInformation.h"
+#import "FocusedElementInformation.h"
 #import "UIKitSPI.h"
 #import "WKFormPeripheral.h"
 #import "WKFormPopover.h"
index 097865a..3b948d1 100644 (file)
@@ -69,8 +69,8 @@ CGFloat adjustedFontSize(CGFloat textWidth, UIFont *font, CGFloat initialFontSiz
         return nil;
 
     bool hasGroups = false;
-    for (size_t i = 0; i < view.assistedNodeInformation.selectOptions.size(); ++i) {
-        if (view.assistedNodeInformation.selectOptions[i].isGroup) {
+    for (size_t i = 0; i < view.focusedElementInformation.selectOptions.size(); ++i) {
+        if (view.focusedElementInformation.selectOptions[i].isGroup) {
             hasGroups = true;
             break;
         }
@@ -78,7 +78,7 @@ CGFloat adjustedFontSize(CGFloat textWidth, UIFont *font, CGFloat initialFontSiz
 
     if (currentUserInterfaceIdiomIsPad())
         _control = adoptNS([[WKSelectPopover alloc] initWithView:view hasGroups:hasGroups]);
-    else if (view.assistedNodeInformation.isMultiSelect || hasGroups)
+    else if (view.focusedElementInformation.isMultiSelect || hasGroups)
         _control = adoptNS([[WKMultipleSelectPicker alloc] initWithView:view]);
     else
         _control = adoptNS([[WKSelectSinglePicker alloc] initWithView:view]);
index da26bb3..520aa14 100644 (file)
@@ -146,7 +146,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
         return nil;
 
     _view = view;
-    _allowsMultipleSelection = _view.assistedNodeInformation.isMultiSelect;
+    _allowsMultipleSelection = _view.focusedElementInformation.isMultiSelect;
     _singleSelectionIndex = NSNotFound;
     [self setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
     [self setDataSource:self];
@@ -165,7 +165,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
     [self reloadAllComponents];
 
     if (!_allowsMultipleSelection) {
-        const Vector<OptionItem>& selectOptions = [_view assistedNodeSelectOptions];
+        const Vector<OptionItem>& selectOptions = [_view focusedSelectElementOptions];
         for (size_t i = 0; i < selectOptions.size(); ++i) {
             const OptionItem& item = selectOptions[i];
             if (item.isGroup)
@@ -219,7 +219,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
 - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)rowIndex forComponent:(NSInteger)columnIndex reusingView:(UIView *)view
 {
-    const OptionItem& item = [_view assistedNodeSelectOptions][rowIndex];
+    const OptionItem& item = [_view focusedSelectElementOptions][rowIndex];
     UIPickerContentView* pickerItem = item.isGroup ? [[[WKOptionGroupPickerCell alloc] initWithOptionItem:item] autorelease] : [[[WKOptionPickerCell alloc] initWithOptionItem:item] autorelease];
 
     // The cell starts out with a null frame. We need to set its frame now so we can find the right font size.
@@ -235,7 +235,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
     UIFont *font = titleTextLabel.font;
     if (width != _maximumTextWidth || _fontSize == 0) {
         _maximumTextWidth = width;
-        _fontSize = adjustedFontSize(_maximumTextWidth, font, titleTextLabel.font.pointSize, [_view assistedNodeSelectOptions]);
+        _fontSize = adjustedFontSize(_maximumTextWidth, font, titleTextLabel.font.pointSize, [_view focusedSelectElementOptions]);
     }
 
     [titleTextLabel setFont:[font fontWithSize:_fontSize]];
@@ -253,15 +253,15 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
 - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)columnIndex
 {
-    return [_view assistedNodeSelectOptions].size();
+    return [_view focusedSelectElementOptions].size();
 }
 
 - (NSInteger)findItemIndexAt:(int)rowIndex
 {
-    ASSERT(rowIndex >= 0 && (size_t)rowIndex < [_view assistedNodeSelectOptions].size());
+    ASSERT(rowIndex >= 0 && (size_t)rowIndex < [_view focusedSelectElementOptions].size());
     NSInteger itemIndex = 0;
     for (int i = 0; i < rowIndex; ++i) {
-        if ([_view assistedNodeSelectOptions][i].isGroup)
+        if ([_view focusedSelectElementOptions][i].isGroup)
             continue;
         itemIndex++;
     }
@@ -272,10 +272,10 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
 - (void)pickerView:(UIPickerView *)pickerView row:(int)rowIndex column:(int)columnIndex checked:(BOOL)isChecked
 {
-    if ((size_t)rowIndex >= [_view assistedNodeSelectOptions].size())
+    if ((size_t)rowIndex >= [_view focusedSelectElementOptions].size())
         return;
 
-    OptionItem& item = [_view assistedNodeSelectOptions][rowIndex];
+    OptionItem& item = [_view focusedSelectElementOptions][rowIndex];
 
     // FIXME: Remove this workaround once <rdar://problem/18745253> is fixed.
     // Group rows should not be checkable, but we are getting this delegate for
@@ -289,7 +289,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
     }
 
     if ([self allowsMultipleSelection]) {
-        [_view page]->setAssistedNodeSelectedIndex([self findItemIndexAt:rowIndex], true);
+        [_view page]->setFocusedElementSelectedIndex([self findItemIndexAt:rowIndex], true);
         item.isSelected = isChecked;
     } else {
         // Single selection.
@@ -299,7 +299,7 @@ static const float GroupOptionTextColorAlpha = 0.5;
         // This private delegate often gets called for multiple rows in the picker,
         // so we only activate and set as selected the checked item in single selection.
         if (isChecked) {
-            [_view page]->setAssistedNodeSelectedIndex([self findItemIndexAt:rowIndex]);
+            [_view page]->setFocusedElementSelectedIndex([self findItemIndexAt:rowIndex]);
             item.isSelected = YES;
         }
     }
@@ -333,8 +333,8 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
     _selectedIndex = NSNotFound;
 
-    for (size_t i = 0; i < [view assistedNodeSelectOptions].size(); ++i) {
-        if ([_view assistedNodeSelectOptions][i].isSelected) {
+    for (size_t i = 0; i < [view focusedSelectElementOptions].size(); ++i) {
+        if ([_view focusedSelectElementOptions][i].isSelected) {
             _selectedIndex = i;
             break;
         }
@@ -370,9 +370,9 @@ static const float GroupOptionTextColorAlpha = 0.5;
     if (_selectedIndex == NSNotFound)
         return;
 
-    if (_selectedIndex < (NSInteger)[_view assistedNodeSelectOptions].size()) {
-        [_view assistedNodeSelectOptions][_selectedIndex].isSelected = true;
-        [_view page]->setAssistedNodeSelectedIndex(_selectedIndex);
+    if (_selectedIndex < (NSInteger)[_view focusedSelectElementOptions].size()) {
+        [_view focusedSelectElementOptions][_selectedIndex].isSelected = true;
+        [_view page]->setFocusedElementSelectedIndex(_selectedIndex);
     }
 }
 
@@ -383,15 +383,15 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
 - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)columnIndex
 {
-    return _view.assistedNodeInformation.selectOptions.size();
+    return _view.focusedElementInformation.selectOptions.size();
 }
 
 - (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component
 {
-    if (row < 0 || row >= (NSInteger)[_view assistedNodeSelectOptions].size())
+    if (row < 0 || row >= (NSInteger)[_view focusedSelectElementOptions].size())
         return nil;
 
-    const OptionItem& option = [_view assistedNodeSelectOptions][row];
+    const OptionItem& option = [_view focusedSelectElementOptions][row];
     NSMutableString *trimmedText = [[option.text mutableCopy] autorelease];
     CFStringTrimWhitespace((CFMutableStringRef)trimmedText);
 
@@ -404,16 +404,16 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
 - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
 {
-    if (row < 0 || row >= (NSInteger)[_view assistedNodeSelectOptions].size())
+    if (row < 0 || row >= (NSInteger)[_view focusedSelectElementOptions].size())
         return;
 
-    const OptionItem& newSelectedOption = [_view assistedNodeSelectOptions][row];
+    const OptionItem& newSelectedOption = [_view focusedSelectElementOptions][row];
     if (newSelectedOption.disabled) {
         NSInteger rowToSelect = NSNotFound;
 
         // Search backwards for the previous enabled option.
         for (NSInteger i = row - 1; i >= 0; --i) {
-            const OptionItem& earlierOption = [_view assistedNodeSelectOptions][i];
+            const OptionItem& earlierOption = [_view focusedSelectElementOptions][i];
             if (!earlierOption.disabled) {
                 rowToSelect = i;
                 break;
@@ -422,8 +422,8 @@ static const float GroupOptionTextColorAlpha = 0.5;
 
         // If nothing previous, search forwards for the next enabled option.
         if (rowToSelect == NSNotFound) {
-            for (size_t i = row + 1; i < [_view assistedNodeSelectOptions].size(); ++i) {
-                const OptionItem& laterOption = [_view assistedNodeSelectOptions][i];
+            for (size_t i = row + 1; i < [_view focusedSelectElementOptions].size(); ++i) {
+                const OptionItem& laterOption = [_view focusedSelectElementOptions][i];
                 if (!laterOption.disabled) {
                     rowToSelect = i;
                     break;
index 53c25d0..f5b6671 100644 (file)
@@ -104,8 +104,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
         return nil;
     
     _contentView = view;
-    Vector<OptionItem>& selectOptions = [_contentView assistedNodeSelectOptions];
-    _allowsMultipleSelection = _contentView.assistedNodeInformation.isMultiSelect;
+    Vector<OptionItem>& selectOptions = [_contentView focusedSelectElementOptions];
+    _allowsMultipleSelection = _contentView.focusedElementInformation.isMultiSelect;
     
     // Even if the select is empty, there is at least one tableview section.
     _numberOfSections = 1;
@@ -126,7 +126,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    UITextWritingDirection writingDirection = _contentView.assistedNodeInformation.isRTL ? UITextWritingDirectionRightToLeft : UITextWritingDirectionLeftToRight;
+    UITextWritingDirection writingDirection = _contentView.focusedElementInformation.isRTL ? UITextWritingDirectionRightToLeft : UITextWritingDirectionLeftToRight;
     BOOL override = NO;
     _textAlignment = (writingDirection == UITextWritingDirectionLeftToRight) ? NSTextAlignmentLeft : NSTextAlignmentRight;
 
@@ -135,7 +135,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     // For that reason we have to override what the system thinks.
     if (writingDirection == UITextWritingDirectionRightToLeft)
         self.view.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
-    [self setTitle:stringWithWritingDirection(_contentView.assistedNodeInformation.title, writingDirection, override)];
+    [self setTitle:stringWithWritingDirection(_contentView.focusedElementInformation.title, writingDirection, override)];
     ALLOW_DEPRECATED_DECLARATIONS_END
 
     return self;
@@ -167,12 +167,12 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
 {
-    if ([_contentView assistedNodeSelectOptions].isEmpty())
+    if ([_contentView focusedSelectElementOptions].isEmpty())
         return 1;
     
     int rowCount = 0;
-    for (size_t i = 0; i < [_contentView assistedNodeSelectOptions].size(); ++i) {
-        const OptionItem& item = [_contentView assistedNodeSelectOptions][i];
+    for (size_t i = 0; i < [_contentView focusedSelectElementOptions].size(); ++i) {
+        const OptionItem& item = [_contentView focusedSelectElementOptions][i];
         if (item.isGroup)
             continue;
         if (item.parentGroupID == section)
@@ -190,8 +190,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
         return nil;
     
     int groupCount = 0;
-    for (size_t i = 0; i < [_contentView assistedNodeSelectOptions].size(); ++i) {
-        const OptionItem& item = [_contentView assistedNodeSelectOptions][i];
+    for (size_t i = 0; i < [_contentView focusedSelectElementOptions].size(); ++i) {
+        const OptionItem& item = [_contentView focusedSelectElementOptions][i];
         if (!item.isGroup)
             continue;
         groupCount++;
@@ -216,8 +216,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     
     int optionIndex = 0;
     int rowIndex = 0;
-    for (size_t i = 0; i < [_contentView assistedNodeSelectOptions].size(); ++i) {
-        const OptionItem& item = [_contentView assistedNodeSelectOptions][i];
+    for (size_t i = 0; i < [_contentView focusedSelectElementOptions].size(); ++i) {
+        const OptionItem& item = [_contentView focusedSelectElementOptions][i];
         if (item.isGroup) {
             rowIndex = 0;
             continue;
@@ -236,8 +236,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     ASSERT(indexPath.section <= _numberOfSections);
 
     int index = 0;
-    for (size_t i = 0; i < [_contentView assistedNodeSelectOptions].size(); ++i) {
-        OptionItem& item = [_contentView assistedNodeSelectOptions][i];
+    for (size_t i = 0; i < [_contentView focusedSelectElementOptions].size(); ++i) {
+        OptionItem& item = [_contentView focusedSelectElementOptions][i];
         if (item.isGroup || item.parentGroupID != indexPath.section)
             continue;
         if (index == indexPath.row)
@@ -256,7 +256,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     cell.semanticContentAttribute = self.view.semanticContentAttribute;
     cell.textLabel.textAlignment = _textAlignment;
     
-    if (_contentView.assistedNodeInformation.selectOptions.isEmpty()) {
+    if (_contentView.focusedElementInformation.selectOptions.isEmpty()) {
         cell.textLabel.enabled = NO;
         cell.textLabel.text = WEB_UI_STRING_KEY("No Options", "No Options Select Popover", "Empty select list");
         cell.accessoryType = UITableViewCellAccessoryNone;
@@ -273,7 +273,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     ASSERT(initialFontSize);
     if (textRect.size.width != _maximumTextWidth || _fontSize == 0) {
         _maximumTextWidth = textRect.size.width;
-        _fontSize = adjustedFontSize(_maximumTextWidth, font, initialFontSize, _contentView.assistedNodeInformation.selectOptions);
+        _fontSize = adjustedFontSize(_maximumTextWidth, font, initialFontSize, _contentView.focusedElementInformation.selectOptions);
     }
     
     const OptionItem* item = [self findItemAt:indexPath];
@@ -288,7 +288,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
-    if (_contentView.assistedNodeInformation.selectOptions.isEmpty())
+    if (_contentView.focusedElementInformation.selectOptions.isEmpty())
         return;
     
     NSInteger itemIndex = [self findItemIndexAt:indexPath];
@@ -311,8 +311,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
         // SPI which mimics a user action on the <select>. Normally programmatic
         // changes do not trigger "change" events on such selects.
     
-        [_contentView page]->setAssistedNodeSelectedIndex(itemIndex, true);
-        OptionItem& item = [_contentView assistedNodeSelectOptions][itemIndex];
+        [_contentView page]->setFocusedElementSelectedIndex(itemIndex, true);
+        OptionItem& item = [_contentView focusedSelectElementOptions][itemIndex];
         item.isSelected = newStateIsSelected;
     } else {
         [tableView deselectRowAtIndexPath:indexPath animated:NO];
@@ -344,8 +344,8 @@ ALLOW_DEPRECATED_DECLARATIONS_END
             _singleSelectionIndex = indexPath.row;
             _singleSelectionSection = indexPath.section;
  
-            [_contentView page]->setAssistedNodeSelectedIndex(itemIndex);
-            OptionItem& newItem = [_contentView assistedNodeSelectOptions][itemIndex];
+            [_contentView page]->setFocusedElementSelectedIndex(itemIndex);
+            OptionItem& newItem = [_contentView focusedSelectElementOptions][itemIndex];
             newItem.isSelected = true;
         }
         
@@ -393,7 +393,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     [_tableViewController setPopover:self];
     UIViewController *popoverViewController = _tableViewController.get();
     UINavigationController *navController = nil;
-    BOOL needsNavigationController = !view.assistedNodeInformation.title.isEmpty();
+    BOOL needsNavigationController = !view.focusedElementInformation.title.isEmpty();
     if (needsNavigationController) {
         navController = [[UINavigationController alloc] initWithRootViewController:_tableViewController.get()];
         popoverViewController = navController;
index 03b1f23..2e9f0d8 100644 (file)
                C54256BA18BEC18C00DE4179 /* WKFormSelectControl.h in Headers */ = {isa = PBXBuildFile; fileRef = C54256B418BEC18C00DE4179 /* WKFormSelectControl.h */; };
                C55F91711C59676E0029E92D /* DataDetectionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = C55F916C1C595E440029E92D /* DataDetectionResult.h */; };
                C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C574A57F12E66681002DFE98 /* PasteboardTypes.h */; };
-               C59C4A5918B81174007BDCB6 /* AssistedNodeInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = C59C4A5718B81174007BDCB6 /* AssistedNodeInformation.h */; };
+               C59C4A5918B81174007BDCB6 /* FocusedElementInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = C59C4A5718B81174007BDCB6 /* FocusedElementInformation.h */; };
                C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = C5BCE5DA1C50761D00CDE3FA /* InteractionInformationAtPosition.h */; };
                C5E1AFE916B20B75006CC1F2 /* WKWebArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = BC329DA616ACE5A900316DE2 /* WKWebArchive.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C5E1AFEB16B20B7E006CC1F2 /* WKWebArchiveResource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC329DAA16ACE5C000316DE2 /* WKWebArchiveResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C57193BD18C14A43002D0F12 /* WKFormSelectControl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFormSelectControl.mm; path = ios/forms/WKFormSelectControl.mm; sourceTree = "<group>"; };
                C574A57F12E66681002DFE98 /* PasteboardTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardTypes.h; sourceTree = "<group>"; };
                C574A58012E66681002DFE98 /* PasteboardTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardTypes.mm; sourceTree = "<group>"; };
-               C59C4A5618B81174007BDCB6 /* AssistedNodeInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssistedNodeInformation.cpp; sourceTree = "<group>"; };
-               C59C4A5718B81174007BDCB6 /* AssistedNodeInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssistedNodeInformation.h; sourceTree = "<group>"; };
+               C59C4A5618B81174007BDCB6 /* FocusedElementInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FocusedElementInformation.cpp; sourceTree = "<group>"; };
+               C59C4A5718B81174007BDCB6 /* FocusedElementInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FocusedElementInformation.h; sourceTree = "<group>"; };
                C5BCE5DA1C50761D00CDE3FA /* InteractionInformationAtPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InteractionInformationAtPosition.h; path = ios/InteractionInformationAtPosition.h; sourceTree = "<group>"; };
                C5BCE5DB1C50761D00CDE3FA /* InteractionInformationAtPosition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InteractionInformationAtPosition.mm; path = ios/InteractionInformationAtPosition.mm; sourceTree = "<group>"; };
                C5FA1ED118E1062200B3F402 /* WKAirPlayRoutePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKAirPlayRoutePicker.h; path = ios/forms/WKAirPlayRoutePicker.h; sourceTree = "<group>"; };
                                BC329D9916ACCE9900316DE2 /* APIWebArchive.mm */,
                                BC329D9F16ACD47800316DE2 /* APIWebArchiveResource.h */,
                                BC329D9E16ACD47800316DE2 /* APIWebArchiveResource.mm */,
-                               C59C4A5618B81174007BDCB6 /* AssistedNodeInformation.cpp */,
-                               C59C4A5718B81174007BDCB6 /* AssistedNodeInformation.h */,
                                515E7725183DD6F60007203F /* AsyncRequest.cpp */,
                                515E7726183DD6F60007203F /* AsyncRequest.h */,
                                E164A2EF191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.cpp */,
                                E105FE5318D7B9DE008F57A8 /* EditingRange.h */,
                                8CFECE931490F140002AAA32 /* EditorState.cpp */,
                                1AA41AB412C02EC4002BE67B /* EditorState.h */,
+                               C59C4A5618B81174007BDCB6 /* FocusedElementInformation.cpp */,
+                               C59C4A5718B81174007BDCB6 /* FocusedElementInformation.h */,
                                BCE81D8A1319F7EF00241910 /* FontInfo.cpp */,
                                BCE81D8B1319F7EF00241910 /* FontInfo.h */,
                                1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */,
                                A175C44A21AA3171000037D0 /* ArgumentCodersCocoa.h in Headers */,
                                E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */,
                                CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */,
-                               C59C4A5918B81174007BDCB6 /* AssistedNodeInformation.h in Headers */,
                                515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
                                BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */,
                                E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */,
                                1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
                                00B9661A18E25AE100CE1F88 /* FindClient.h in Headers */,
                                1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
+                               C59C4A5918B81174007BDCB6 /* FocusedElementInformation.h in Headers */,
                                BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
                                1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
                                1AE00D611831792100087DD7 /* FrameLoadState.h in Headers */,
index bf64714..a3292aa 100644 (file)
@@ -200,17 +200,17 @@ void WebChromeClient::unfocus()
 
 void WebChromeClient::elementDidFocus(Element& element)
 {
-    m_page.elementDidFocus(&element);
+    m_page.elementDidFocus(element);
 }
 
 void WebChromeClient::elementDidRefocus(Element& element)
 {
-    m_page.elementDidRefocus(&element);
+    m_page.elementDidRefocus(element);
 }
 
 void WebChromeClient::elementDidBlur(Element& element)
 {
-    m_page.elementDidBlur(&element);
+    m_page.elementDidBlur(element);
 }
 
 void WebChromeClient::makeFirstResponder()
index c29bd4d..7f0443e 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "APIArray.h"
 #include "APIGeometry.h"
-#include "AssistedNodeInformation.h"
 #include "DataReference.h"
 #include "DragControllerAction.h"
 #include "DrawingArea.h"
@@ -3059,7 +3058,7 @@ void WebPage::didStartPageTransition()
     bool hasPreviouslyFocusedDueToUserInteraction = m_hasEverFocusedElementDueToUserInteractionSincePageTransition;
 #endif
     m_hasEverFocusedElementDueToUserInteractionSincePageTransition = false;
-    m_isAssistingNodeDueToUserInteraction = false;
+    m_isFocusingElementDueToUserInteraction = false;
     m_lastEditorStateWasContentEditable = EditorStateIsContentEditable::Unset;
 #if PLATFORM(MAC)
     if (hasPreviouslyFocusedDueToUserInteraction)
@@ -4971,8 +4970,8 @@ void WebPage::setTextAsync(const String& text)
         return;
     }
 
-    if (is<HTMLInputElement>(m_assistedNode.get())) {
-        downcast<HTMLInputElement>(*m_assistedNode).setValueForUser(text);
+    if (is<HTMLInputElement>(m_focusedElement.get())) {
+        downcast<HTMLInputElement>(*m_focusedElement).setValueForUser(text);
         return;
     }
 
@@ -5264,52 +5263,53 @@ void WebPage::didChangeSelection()
     sendPartialEditorStateAndSchedulePostLayoutUpdate();
 }
 
-void WebPage::resetAssistedNodeForFrame(WebFrame* frame)
+void WebPage::resetFocusedElementForFrame(WebFrame* frame)
 {
-    if (!m_assistedNode)
+    if (!m_focusedElement)
         return;
-    if (frame->isMainFrame() || m_assistedNode->document().frame() == frame->coreFrame()) {
+
+    if (frame->isMainFrame() || m_focusedElement->document().frame() == frame->coreFrame()) {
 #if PLATFORM(IOS_FAMILY)
-        send(Messages::WebPageProxy::StopAssistingNode());
+        send(Messages::WebPageProxy::ElementDidBlur());
 #elif PLATFORM(MAC)
         send(Messages::WebPageProxy::SetEditableElementIsFocused(false));
 #endif
-        m_assistedNode = nullptr;
+        m_focusedElement = nullptr;
     }
 }
 
-void WebPage::elementDidRefocus(WebCore::Node* node)
+void WebPage::elementDidRefocus(WebCore::Element& element)
 {
-    elementDidFocus(node);
+    elementDidFocus(element);
     m_hasPendingEditorStateUpdate = true;
 }
 
-void WebPage::elementDidFocus(WebCore::Node* node)
+void WebPage::elementDidFocus(WebCore::Element& element)
 {
-    if (m_assistedNode == node && m_isAssistingNodeDueToUserInteraction)
+    if (m_focusedElement == &element && m_isFocusingElementDueToUserInteraction)
         return;
 
-    if (node->hasTagName(WebCore::HTMLNames::selectTag) || node->hasTagName(WebCore::HTMLNames::inputTag) || node->hasTagName(WebCore::HTMLNames::textareaTag) || node->hasEditableStyle()) {
-        m_assistedNode = node;
-        m_isAssistingNodeDueToUserInteraction |= m_userIsInteracting;
+    if (element.hasTagName(WebCore::HTMLNames::selectTag) || element.hasTagName(WebCore::HTMLNames::inputTag) || element.hasTagName(WebCore::HTMLNames::textareaTag) || element.hasEditableStyle()) {
+        m_focusedElement = &element;
+        m_isFocusingElementDueToUserInteraction |= m_userIsInteracting;
 
 #if PLATFORM(IOS_FAMILY)
 
 #if ENABLE(FULLSCREEN_API)
-        if (node->document().webkitIsFullScreen())
-            node->document().webkitCancelFullScreen();
+        if (element.document().webkitIsFullScreen())
+            element.document().webkitCancelFullScreen();
 #endif
 
-        ++m_currentAssistedNodeIdentifier;
-        AssistedNodeInformation information;
-        getAssistedNodeInformation(information);
+        ++m_currentFocusedElementIdentifier;
+        FocusedElementInformation information;
+        getFocusedElementInformation(information);
         RefPtr<API::Object> userData;
 
-        m_formClient->willBeginInputSession(this, downcast<Element>(node), WebFrame::fromCoreFrame(*node->document().frame()), m_userIsInteracting, userData);
+        m_formClient->willBeginInputSession(this, &element, WebFrame::fromCoreFrame(*element.document().frame()), m_userIsInteracting, userData);
 
-        send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, m_hasPendingBlurNotification, m_changingActivityState, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+        send(Messages::WebPageProxy::ElementDidFocus(information, m_userIsInteracting, m_hasPendingBlurNotification, m_changingActivityState, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 #elif PLATFORM(MAC)
-        if (node->hasTagName(WebCore::HTMLNames::selectTag))
+        if (element.hasTagName(WebCore::HTMLNames::selectTag))
             send(Messages::WebPageProxy::SetEditableElementIsFocused(false));
         else
             send(Messages::WebPageProxy::SetEditableElementIsFocused(true));
@@ -5318,15 +5318,15 @@ void WebPage::elementDidFocus(WebCore::Node* node)
     }
 }
 
-void WebPage::elementDidBlur(WebCore::Node* node)
+void WebPage::elementDidBlur(WebCore::Element& element)
 {
-    if (m_assistedNode == node) {
+    if (m_focusedElement == &element) {
         m_hasPendingBlurNotification = true;
         RefPtr<WebPage> protectedThis(this);
         callOnMainThread([protectedThis] {
             if (protectedThis->m_hasPendingBlurNotification) {
 #if PLATFORM(IOS_FAMILY)
-                protectedThis->send(Messages::WebPageProxy::StopAssistingNode());
+                protectedThis->send(Messages::WebPageProxy::ElementDidBlur());
 #elif PLATFORM(MAC)
                 protectedThis->send(Messages::WebPageProxy::SetEditableElementIsFocused(false));
 #endif
@@ -5334,8 +5334,8 @@ void WebPage::elementDidBlur(WebCore::Node* node)
             protectedThis->m_hasPendingBlurNotification = false;
         });
 
-        m_isAssistingNodeDueToUserInteraction = false;
-        m_assistedNode = nullptr;
+        m_isFocusingElementDueToUserInteraction = false;
+        m_focusedElement = nullptr;
     }
 }
 
@@ -5535,7 +5535,7 @@ void WebPage::didCommitLoad(WebFrame* frame)
     frame->setFirstLayerTreeTransactionIDAfterDidCommitLoad(downcast<RemoteLayerTreeDrawingArea>(*m_drawingArea).nextTransactionID());
     cancelPotentialTapInFrame(*frame);
 #endif
-    resetAssistedNodeForFrame(frame);
+    resetFocusedElementForFrame(frame);
 
     if (!frame->isMainFrame())
         return;
index a71cb04..fc4ea1d 100644 (file)
@@ -35,6 +35,7 @@
 #include "CallbackID.h"
 #include "DrawingAreaInfo.h"
 #include "EditingRange.h"
+#include "FocusedElementInformation.h"
 #include "InjectedBundlePageContextMenuClient.h"
 #include "InjectedBundlePageFullScreenClient.h"
 #include "InjectedBundlePagePolicyClient.h"
@@ -240,7 +241,6 @@ enum FindOptions : uint16_t;
 enum class DragControllerAction : uint8_t;
 enum class WebPolicyAction : uint8_t;
 
-struct AssistedNodeInformation;
 struct AttributedString;
 struct DataDetectionResult;
 struct BackForwardListItemState;
@@ -585,11 +585,10 @@ public:
     void captureDevicesChanged();
 #endif
 
-    // FIXME: These should all take Element& instead of Node*.
-    void elementDidFocus(WebCore::Node*);
-    void elementDidRefocus(WebCore::Node*);
-    void elementDidBlur(WebCore::Node*);
-    void resetAssistedNodeForFrame(WebFrame*);
+    void elementDidFocus(WebCore::Element&);
+    void elementDidRefocus(WebCore::Element&);
+    void elementDidBlur(WebCore::Element&);
+    void resetFocusedElementForFrame(WebFrame*);
 
     void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
@@ -622,21 +621,21 @@ public:
     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
 
-    void blurAssistedNode();
-    void requestAssistedNodeInformation(CallbackID);
-    void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID);
+    void blurFocusedElement();
+    void requestFocusedElementInformation(CallbackID);
+    void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID);
     void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
     void extendSelection(uint32_t granularity);
     void selectWordBackward();
     void moveSelectionByOffset(int32_t offset, CallbackID);
-    void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
-    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, CallbackID);
+    void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
+    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID);
     void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
-    void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
+    void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
     void beginSelectionInDirection(uint32_t direction, CallbackID);
-    void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
-    void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
+    void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
+    void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
 
     void requestDictationContext(CallbackID);
     void replaceDictatedText(const String& oldText, const String& newText);
@@ -651,11 +650,11 @@ public:
     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
     void stopInteraction();
     void performActionOnElement(uint32_t action);
-    void focusNextAssistedNode(bool isForward, CallbackID);
+    void focusNextFocusedElement(bool isForward, CallbackID);
     void autofillLoginCredentials(const String&, const String&);
-    void setAssistedNodeValue(const String&);
-    void setAssistedNodeValueAsNumber(double);
-    void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
+    void setFocusedElementValue(const String&);
+    void setFocusedElementValueAsNumber(double);
+    void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection);
     WebCore::IntRect rectForElementAtInteractionLocation();
     void updateSelectionAppearance();
     void getSelectionContext(CallbackID);
@@ -1166,14 +1165,14 @@ private:
 
     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
     RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
-    void getAssistedNodeInformation(AssistedNodeInformation&);
+    void getFocusedElementInformation(FocusedElementInformation&);
     void platformInitializeAccessibility();
     void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
     void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
     void resetTextAutosizing();
-    WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
-    RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);
+    WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement);
+    RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement);
 #endif
 
 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
@@ -1672,7 +1671,7 @@ private:
     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
 
     bool m_userIsInteracting { false };
-    bool m_isAssistingNodeDueToUserInteraction { false };
+    bool m_isFocusingElementDueToUserInteraction { false };
     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
     bool m_needsHiddenContentEditableQuirk { false };
     bool m_needsPlainTextQuirk { false };
@@ -1682,7 +1681,7 @@ private:
     bool m_isShowingContextMenu { false };
 #endif
 
-    RefPtr<WebCore::Node> m_assistedNode;
+    RefPtr<WebCore::Element> m_focusedElement;
     bool m_hasPendingBlurNotification { false };
     bool m_hasPendingEditorStateUpdate { false };
     
@@ -1724,7 +1723,7 @@ private:
     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
     WebCore::FloatPoint m_pendingSyntheticClickLocation;
     WebCore::FloatRect m_previousExposedContentRect;
-    uint64_t m_currentAssistedNodeIdentifier { 0 };
+    FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 };
     Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
     double m_lastTransactionPageScaleFactor { 0 };
     uint64_t m_lastTransactionIDWithScaleChange { 0 };
index bc9e3ec..e2654d9 100644 (file)
@@ -58,20 +58,20 @@ messages -> WebPage LegacyReceiver {
     TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point)
     InspectorNodeSearchMovedToPosition(WebCore::FloatPoint point)
     InspectorNodeSearchEndedAtPosition(WebCore::FloatPoint point)
-    BlurAssistedNode()
-    SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
+    BlurFocusedElement()
+    SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
     UpdateSelectionWithTouches(WebCore::IntPoint point, uint32_t touches, bool baseIsStart, WebKit::CallbackID callbackID)
     SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WebKit::CallbackID callbackID)
     ExtendSelection(uint32_t granularity)
     SelectWordBackward()
     MoveSelectionByOffset(int32_t offset, WebKit::CallbackID callbackID)
-    SelectTextWithGranularityAtPoint(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
-    SelectPositionAtBoundaryWithDirection(WebCore::IntPoint point, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
+    SelectTextWithGranularityAtPoint(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
+    SelectPositionAtBoundaryWithDirection(WebCore::IntPoint point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
     MoveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, WebKit::CallbackID callbackID)
-    SelectPositionAtPoint(WebCore::IntPoint point, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
+    SelectPositionAtPoint(WebCore::IntPoint point, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
     BeginSelectionInDirection(uint32_t direction, WebKit::CallbackID callbackID)
-    UpdateSelectionWithExtentPoint(WebCore::IntPoint point, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
-    UpdateSelectionWithExtentPointAndBoundary(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
+    UpdateSelectionWithExtentPoint(WebCore::IntPoint point, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
+    UpdateSelectionWithExtentPointAndBoundary(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
     RequestDictationContext(WebKit::CallbackID callbackID)
     ReplaceDictatedText(String oldText, String newText)
     ReplaceSelectedText(String oldText, String newText)
@@ -85,11 +85,11 @@ messages -> WebPage LegacyReceiver {
     StartInteractionWithElementAtPosition(WebCore::IntPoint point)
     StopInteraction()
     PerformActionOnElement(uint32_t action)
-    FocusNextAssistedNode(bool isForward, WebKit::CallbackID callbackID)
-    SetAssistedNodeValue(String value)
+    FocusNextFocusedElement(bool isForward, WebKit::CallbackID callbackID)
+    SetFocusedElementValue(String value)
     AutofillLoginCredentials(String username, String password)
-    SetAssistedNodeValueAsNumber(double value)
-    SetAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection)
+    SetFocusedElementValueAsNumber(double value)
+    SetFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection)
     ApplicationWillResignActive()
     ApplicationDidEnterBackground(bool isSuspendedUnderLock)
     ApplicationDidFinishSnapshottingAfterEnteringBackground()
@@ -106,7 +106,7 @@ messages -> WebPage LegacyReceiver {
     StoreSelectionForAccessibility(bool shouldStore)
     StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow)
     CancelAutoscroll()
-    RequestAssistedNodeInformation(WebKit::CallbackID callbackID)
+    RequestFocusedElementInformation(WebKit::CallbackID callbackID)
     HardwareKeyboardAvailabilityChanged()
 #endif
 
index 9f99b4b..c1502ac 100644 (file)
@@ -29,7 +29,6 @@
 #if PLATFORM(IOS_FAMILY)
 
 #import "AccessibilityIOS.h"
-#import "AssistedNodeInformation.h"
 #import "DataReference.h"
 #import "DrawingArea.h"
 #import "EditingRange.h"
@@ -241,10 +240,10 @@ void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePost
     }
     postLayoutData.insideFixedPosition = startNodeIsInsideFixedPosition || endNodeIsInsideFixedPosition;
     if (!selection.isNone()) {
-        if (m_assistedNode && m_assistedNode->renderer()) {
-            postLayoutData.selectionClipRect = view->contentsToRootView(m_assistedNode->renderer()->absoluteBoundingBoxRect());
-            postLayoutData.caretColor = m_assistedNode->renderer()->style().caretColor();
-            postLayoutData.elementIsTransparent = m_assistedNode->renderer()->isTransparentRespectingParentFrames();
+        if (m_focusedElement && m_focusedElement->renderer()) {
+            postLayoutData.selectionClipRect = view->contentsToRootView(m_focusedElement->renderer()->absoluteBoundingBoxRect());
+            postLayoutData.caretColor = m_focusedElement->renderer()->style().caretColor();
+            postLayoutData.elementIsTransparent = m_focusedElement->renderer()->isTransparentRespectingParentFrames();
         }
         computeEditableRootHasContentAndPlainText(selection, postLayoutData);
     }
@@ -615,7 +614,7 @@ void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore:
     // If the node has been focused by JavaScript without user interaction, the
     // keyboard is not on screen.
     if (newFocusedElement && newFocusedElement == oldFocusedElement)
-        elementDidRefocus(newFocusedElement.get());
+        elementDidRefocus(*newFocusedElement);
 
     if (!tapWasHandled || !nodeRespondingToClick || !nodeRespondingToClick->isElementNode())
         send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(location)));
@@ -643,13 +642,13 @@ void WebPage::handleTap(const IntPoint& point, uint64_t lastLayerTreeTransaction
         handleSyntheticClick(nodeRespondingToClick, adjustedPoint);
 }
 
-void WebPage::requestAssistedNodeInformation(WebKit::CallbackID callbackID)
+void WebPage::requestFocusedElementInformation(WebKit::CallbackID callbackID)
 {
-    AssistedNodeInformation info;
-    if (m_assistedNode)
-        getAssistedNodeInformation(info);
+    FocusedElementInformation info;
+    if (m_focusedElement)
+        getFocusedElementInformation(info);
 
-    send(Messages::WebPageProxy::AssistedNodeInformationCallback(info, callbackID));
+    send(Messages::WebPageProxy::FocusedElementInformationCallback(info, callbackID));
 }
 
 #if ENABLE(DATA_INTERACTION)
@@ -874,29 +873,31 @@ void WebPage::inspectorNodeSearchEndedAtPosition(const FloatPoint& position)
         node->inspect();
 }
 
-void WebPage::blurAssistedNode()
+void WebPage::blurFocusedElement()
 {
-    if (is<Element>(m_assistedNode.get()))
-        downcast<Element>(*m_assistedNode).blur();
+    if (!m_focusedElement)
+        return;
+
+    m_focusedElement->blur();
 }
 
-void WebPage::setAssistedNodeValue(const String& value)
+void WebPage::setFocusedElementValue(const String& value)
 {
     // FIXME: should also handle the case of HTMLSelectElement.
-    if (is<HTMLInputElement>(m_assistedNode.get()))
-        downcast<HTMLInputElement>(*m_assistedNode).setValue(value, DispatchInputAndChangeEvent);
+    if (is<HTMLInputElement>(m_focusedElement.get()))
+        downcast<HTMLInputElement>(*m_focusedElement).setValue(value, DispatchInputAndChangeEvent);
 }
 
-void WebPage::setAssistedNodeValueAsNumber(double value)
+void WebPage::setFocusedElementValueAsNumber(double value)
 {
-    if (is<HTMLInputElement>(m_assistedNode.get()))
-        downcast<HTMLInputElement>(*m_assistedNode).setValueAsNumber(value, DispatchInputAndChangeEvent);
+    if (is<HTMLInputElement>(m_focusedElement.get()))
+        downcast<HTMLInputElement>(*m_focusedElement).setValueAsNumber(value, DispatchInputAndChangeEvent);
 }
 
-void WebPage::setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection)
+void WebPage::setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection)
 {
-    if (is<HTMLSelectElement>(m_assistedNode.get()))
-        downcast<HTMLSelectElement>(*m_assistedNode).optionSelectedByUser(index, true, allowMultipleSelection);
+    if (is<HTMLSelectElement>(m_focusedElement.get()))
+        downcast<HTMLSelectElement>(*m_focusedElement).optionSelectedByUser(index, true, allowMultipleSelection);
 }
 
 void WebPage::showInspectorHighlight(const WebCore::Highlight& highlight)
@@ -935,13 +936,13 @@ void WebPage::setForceAlwaysUserScalable(bool userScalable)
     m_viewportConfiguration.setForceAlwaysUserScalable(userScalable);
 }
 
-static FloatQuad innerFrameQuad(const Frame& frame, const Node& assistedNode)
+static FloatQuad innerFrameQuad(const Frame& frame, const Element& focusedElement)
 {
     frame.document()->updateLayoutIgnorePendingStylesheets();
     RenderElement* renderer = nullptr;
-    if (assistedNode.hasTagName(HTMLNames::textareaTag) || assistedNode.hasTagName(HTMLNames::inputTag) || assistedNode.hasTagName(HTMLNames::selectTag))
-        renderer = downcast<RenderElement>(assistedNode.renderer());
-    else if (Element* rootEditableElement = assistedNode.rootEditableElement())
+    if (focusedElement.hasTagName(HTMLNames::textareaTag) || focusedElement.hasTagName(HTMLNames::inputTag) || focusedElement.hasTagName(HTMLNames::selectTag))
+        renderer = focusedElement.renderer();
+    else if (auto* rootEditableElement = focusedElement.rootEditableElement())
         renderer = rootEditableElement->renderer();
     
     if (!renderer)
@@ -957,11 +958,11 @@ static FloatQuad innerFrameQuad(const Frame& frame, const Node& assistedNode)
     return FloatQuad(boundingBox);
 }
 
-static IntPoint constrainPoint(const IntPoint& point, const Frame& frame, const Node& assistedNode)
+static IntPoint constrainPoint(const IntPoint& point, const Frame& frame, const Element& focusedElement)
 {
-    ASSERT(&assistedNode.document() == frame.document());
+    ASSERT(&focusedElement.document() == frame.document());
     const int DEFAULT_CONSTRAIN_INSET = 2;
-    IntRect innerFrame = innerFrameQuad(frame, assistedNode).enclosingBoundingBox();
+    IntRect innerFrame = innerFrameQuad(frame, focusedElement).enclosingBoundingBox();
     IntPoint constrainedPoint = point;
 
     int minX = innerFrame.x() + DEFAULT_CONSTRAIN_INSET;
@@ -1089,10 +1090,10 @@ RefPtr<Range> WebPage::rangeForWebSelectionAtPosition(const IntPoint& point, con
     return range->collapsed() ? nullptr : range;
 }
 
-void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
 
     if (position.isNull()) {
         send(Messages::WebPageProxy::GestureCallback(point, gestureType, gestureState, 0, callbackID));
@@ -1462,8 +1463,8 @@ void WebPage::moveSelectionByOffset(int32_t offset, CallbackID callbackID)
     
 void WebPage::startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow)
 {
-    if (m_assistedNode && m_assistedNode->renderer())
-        m_page->mainFrame().eventHandler().startSelectionAutoscroll(m_assistedNode->renderer(), positionInWindow);
+    if (m_focusedElement && m_focusedElement->renderer())
+        m_page->mainFrame().eventHandler().startSelectionAutoscroll(m_focusedElement->renderer(), positionInWindow);
     else {
         Frame& frame = m_page->focusController().focusedOrMainFrame();
         VisibleSelection selection = frame.selection().selection();
@@ -1563,27 +1564,27 @@ void WebPage::getRectsAtSelectionOffsetWithText(int32_t offset, const String& te
     send(Messages::WebPageProxy::SelectionRectsCallback(selectionRects, callbackID));
 }
 
-VisiblePosition WebPage::visiblePositionInFocusedNodeForPoint(const Frame& frame, const IntPoint& point, bool isInteractingWithAssistedNode)
+VisiblePosition WebPage::visiblePositionInFocusedNodeForPoint(const Frame& frame, const IntPoint& point, bool isInteractingWithFocusedElement)
 {
     IntPoint adjustedPoint(frame.view()->rootViewToContents(point));
-    IntPoint constrainedPoint = m_assistedNode && isInteractingWithAssistedNode ? constrainPoint(adjustedPoint, frame, *m_assistedNode) : adjustedPoint;
+    IntPoint constrainedPoint = m_focusedElement && isInteractingWithFocusedElement ? constrainPoint(adjustedPoint, frame, *m_focusedElement) : adjustedPoint;
     return frame.visiblePositionForPoint(constrainedPoint);
 }
 
-void WebPage::selectPositionAtPoint(const WebCore::IntPoint& point, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::selectPositionAtPoint(const WebCore::IntPoint& point, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
     
     if (position.isNotNull())
         frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
 
-void WebPage::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint& point, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint& point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
 
     if (position.isNotNull()) {
         position = positionOfNextBoundaryOfGranularity(position, static_cast<WebCore::TextGranularity>(granularity), static_cast<SelectionDirection>(direction));
@@ -1607,9 +1608,9 @@ void WebPage::moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
 
-RefPtr<Range> WebPage::rangeForGranularityAtPoint(Frame& frame, const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode)
+RefPtr<Range> WebPage::rangeForGranularityAtPoint(Frame& frame, const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement)
 {
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
 
     RefPtr<Range> range;
     switch (static_cast<WebCore::TextGranularity>(granularity)) {
@@ -1637,11 +1638,11 @@ static inline bool rectIsTooBigForSelection(const IntRect& blockRect, const Fram
     return blockRect.height() > frame.view()->unobscuredContentRect().height() * factor;
 }
 
-void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithAssistedNode);
-    if (!isInteractingWithAssistedNode) {
+    RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement);
+    if (!isInteractingWithFocusedElement) {
         m_blockSelectionDesiredSize.setWidth(blockSelectionStartWidth);
         m_blockSelectionDesiredSize.setHeight(blockSelectionStartHeight);
         m_currentBlockSelection = nullptr;
@@ -1649,7 +1650,7 @@ void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, u
         if (renderer && renderer->style().preserveNewline())
             m_blockRectForTextSelection = renderer->absoluteBoundingBoxRect(true);
         else {
-            auto paragraphRange = enclosingTextUnitOfGranularity(visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode), ParagraphGranularity, DirectionForward);
+            auto paragraphRange = enclosingTextUnitOfGranularity(visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement), ParagraphGranularity, DirectionForward);
             if (paragraphRange && !paragraphRange->collapsed())
                 m_blockRectForTextSelection = selectionBoxForRange(paragraphRange.get());
         }
@@ -1670,11 +1671,11 @@ void WebPage::beginSelectionInDirection(uint32_t direction, CallbackID callbackI
     send(Messages::WebPageProxy::UnsignedCallback(m_selectionAnchor == Start, callbackID));
 }
 
-void WebPage::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
-    RefPtr<Range> newRange = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
+    RefPtr<Range> newRange = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement);
     
     if (position.isNull() || !m_initialSelection || !newRange) {
         send(Messages::WebPageProxy::UnsignedCallback(false, callbackID));
@@ -1699,10 +1700,10 @@ void WebPage::updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&
     send(Messages::WebPageProxy::UnsignedCallback(selectionStart == m_initialSelection->startPosition(), callbackID));
 }
 
-void WebPage::updateSelectionWithExtentPoint(const WebCore::IntPoint& point, bool isInteractingWithAssistedNode, CallbackID callbackID)
+void WebPage::updateSelectionWithExtentPoint(const WebCore::IntPoint& point, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
+    VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
 
     if (position.isNull()) {
         send(Messages::WebPageProxy::UnsignedCallback(false, callbackID));
@@ -2086,15 +2087,15 @@ void WebPage::getPositionInformation(const InteractionInformationRequest& reques
     FloatPoint adjustedPoint;
     Node* hitNode = m_page->mainFrame().nodeRespondingToClickEvents(request.point, adjustedPoint);
 
-    info.nodeAtPositionIsAssistedNode = (hitNode == m_assistedNode);
-    if (m_assistedNode) {
+    info.nodeAtPositionIsFocusedElement = hitNode == m_focusedElement;
+    if (m_focusedElement) {
         const Frame& frame = m_page->focusController().focusedOrMainFrame();
         if (frame.editor().hasComposition()) {
             const uint32_t kHitAreaWidth = 66;
             const uint32_t kHitAreaHeight = 66;
             FrameView& view = *frame.view();
             IntPoint adjustedPoint(view.rootViewToContents(request.point));
-            IntPoint constrainedPoint = m_assistedNode ? constrainPoint(adjustedPoint, frame, *m_assistedNode) : adjustedPoint;
+            IntPoint constrainedPoint = m_focusedElement ? constrainPoint(adjustedPoint, frame, *m_focusedElement) : adjustedPoint;
             VisiblePosition position = frame.visiblePositionForPoint(constrainedPoint);
 
             RefPtr<Range> compositionRange = frame.editor().compositionRange();
@@ -2336,9 +2337,9 @@ static inline Element* nextAssistableElement(Node* startNode, Page& page, bool i
     return nextElement;
 }
 
-void WebPage::focusNextAssistedNode(bool isForward, CallbackID callbackID)
+void WebPage::focusNextFocusedElement(bool isForward, CallbackID callbackID)
 {
-    Element* nextElement = nextAssistableElement(m_assistedNode.get(), *m_page, isForward);
+    Element* nextElement = nextAssistableElement(m_focusedElement.get(), *m_page, isForward);
     m_userIsInteracting = true;
     if (nextElement)
         nextElement->focus();
@@ -2359,15 +2360,15 @@ static IntRect elementRectInRootViewCoordinates(const Node& node, const Frame& f
     return view->contentsToRootView(renderer->absoluteBoundingBoxRect());
 }
 
-void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
+void WebPage::getFocusedElementInformation(FocusedElementInformation& information)
 {
     layoutIfNeeded();
 
     information.elementInteractionLocation = m_lastInteractionLocation;
 
-    if (RenderObject* renderer = m_assistedNode->renderer()) {
-        Frame& elementFrame = m_page->focusController().focusedOrMainFrame();
-        information.elementRect = elementRectInRootViewCoordinates(*m_assistedNode, elementFrame);
+    if (auto* renderer = m_focusedElement->renderer()) {
+        auto& elementFrame = m_page->focusController().focusedOrMainFrame();
+        information.elementRect = elementRectInRootViewCoordinates(*m_focusedElement, elementFrame);
         information.nodeFontSize = renderer->style().fontDescription().computedSize();
         information.elementIsTransparent = renderer->isTransparentRespectingParentFrames();
 
@@ -2376,7 +2377,7 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
         information.insideFixedPosition = inFixed;
         information.isRTL = renderer->style().direction() == TextDirection::RTL;
 
-        FrameView* frameView = elementFrame.view();
+        auto* frameView = elementFrame.view();
         if (inFixed && elementFrame.isMainFrame() && !frameView->frame().settings().visualViewportEnabled()) {
             IntRect currentFixedPositionRect = frameView->customFixedPositionLayoutRect();
             frameView->setCustomFixedPositionLayoutRect(frameView->renderView()->documentRect());
@@ -2398,20 +2399,20 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
     information.maximumScaleFactorIgnoringAlwaysScalable = maximumPageScaleFactorIgnoringAlwaysScalable();
     information.allowsUserScaling = m_viewportConfiguration.allowsUserScaling();
     information.allowsUserScalingIgnoringAlwaysScalable = m_viewportConfiguration.allowsUserScalingIgnoringAlwaysScalable();
-    if (auto* nextElement = nextAssistableElement(m_assistedNode.get(), *m_page, true)) {
+    if (auto* nextElement = nextAssistableElement(m_focusedElement.get(), *m_page, true)) {
         if (auto* frame = nextElement->document().frame())
             information.nextNodeRect = elementRectInRootViewCoordinates(*nextElement, *frame);
         information.hasNextNode = true;
     }
-    if (auto* previousElement = nextAssistableElement(m_assistedNode.get(), *m_page, false)) {
+    if (auto* previousElement = nextAssistableElement(m_focusedElement.get(), *m_page, false)) {
         if (auto* frame = previousElement->document().frame())
             information.previousNodeRect = elementRectInRootViewCoordinates(*previousElement, *frame);
         information.hasPreviousNode = true;
     }
-    information.assistedNodeIdentifier = m_currentAssistedNodeIdentifier;
+    information.focusedElementIdentifier = m_currentFocusedElementIdentifier;
 
-    if (is<LabelableElement>(*m_assistedNode)) {
-        auto labels = downcast<LabelableElement>(*m_assistedNode).labels();
+    if (is<LabelableElement>(*m_focusedElement)) {
+        auto labels = downcast<LabelableElement>(*m_focusedElement).labels();
         Vector<Ref<Element>> associatedLabels;
         for (unsigned index = 0; index < labels->length(); ++index) {
             if (is<Element>(labels->item(index)) && labels->item(index)->renderer())
@@ -2426,14 +2427,11 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
         }
     }
 
-    if (is<Element>(m_assistedNode.get())) {
-        auto& element = downcast<Element>(*m_assistedNode);
-        information.title = element.title();
-        information.ariaLabel = element.attributeWithoutSynchronization(HTMLNames::aria_labelAttr);
-    }
+    information.title = m_focusedElement->title();
+    information.ariaLabel = m_focusedElement->attributeWithoutSynchronization(HTMLNames::aria_labelAttr);
 
-    if (is<HTMLSelectElement>(*m_assistedNode)) {
-        HTMLSelectElement& element = downcast<HTMLSelectElement>(*m_assistedNode);
+    if (is<HTMLSelectElement>(*m_focusedElement)) {
+        HTMLSelectElement& element = downcast<HTMLSelectElement>(*m_focusedElement);
         information.elementType = InputType::Select;
         const Vector<HTMLElement*>& items = element.listItems();
         size_t count = items.size();
@@ -2454,8 +2452,8 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
         }
         information.selectedIndex = element.selectedIndex();
         information.isMultiSelect = element.multiple();
-    } else if (is<HTMLTextAreaElement>(*m_assistedNode)) {
-        HTMLTextAreaElement& element = downcast<HTMLTextAreaElement>(*m_assistedNode);
+    } else if (is<HTMLTextAreaElement>(*m_focusedElement)) {
+        HTMLTextAreaElement& element = downcast<HTMLTextAreaElement>(*m_focusedElement);
         information.autocapitalizeType = element.autocapitalizeType();
         information.isAutocorrect = element.shouldAutocorrect();
         information.elementType = InputType::TextArea;
@@ -2464,14 +2462,14 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
         information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
         information.placeholder = element.attributeWithoutSynchronization(HTMLNames::placeholderAttr);
         information.inputMode = element.canonicalInputMode();
-    } else if (is<HTMLInputElement>(*m_assistedNode)) {
-        HTMLInputElement& element = downcast<HTMLInputElement>(*m_assistedNode);
+    } else if (is<HTMLInputElement>(*m_focusedElement)) {
+        HTMLInputElement& element = downcast<HTMLInputElement>(*m_focusedElement);
         HTMLFormElement* form = element.form();
         if (form)
             information.formAction = form->getURLAttribute(WebCore::HTMLNames::actionAttr);
         if (auto autofillElements = WebCore::AutofillElements::computeAutofillElements(element)) {
             information.acceptsAutofilledLoginCredentials = true;
-            information.isAutofillableUsernameField = autofillElements->username() == m_assistedNode;
+            information.isAutofillableUsernameField = autofillElements->username() == m_focusedElement;
         }
         information.representingPageURL = element.document().urlForBindings();
         information.autocapitalizeType = element.autocapitalizeType();
@@ -2529,13 +2527,13 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
         information.value = element.value();
         information.valueAsNumber = element.valueAsNumber();
         information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
-    } else if (is<HTMLImageElement>(*m_assistedNode) && downcast<HTMLImageElement>(*m_assistedNode).hasEditableImageAttribute()) {
+    } else if (is<HTMLImageElement>(*m_focusedElement) && downcast<HTMLImageElement>(*m_focusedElement).hasEditableImageAttribute()) {
         information.elementType = InputType::Drawing;
-        information.embeddedViewID = downcast<HTMLImageElement>(*m_assistedNode).editableImageViewID();
-    } else if (m_assistedNode->hasEditableStyle()) {
+        information.embeddedViewID = downcast<HTMLImageElement>(*m_focusedElement).editableImageViewID();
+    } else if (m_focusedElement->hasEditableStyle()) {
         information.elementType = InputType::ContentEditable;
-        if (is<HTMLElement>(*m_assistedNode)) {
-            auto& assistedElement = downcast<HTMLElement>(*m_assistedNode);
+        if (is<HTMLElement>(*m_focusedElement)) {
+            auto& assistedElement = downcast<HTMLElement>(*m_focusedElement);
             information.isAutocorrect = assistedElement.shouldAutocorrect();
             information.autocapitalizeType = assistedElement.autocapitalizeType();
             information.inputMode = assistedElement.canonicalInputMode();
@@ -2549,8 +2547,8 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
 
 void WebPage::autofillLoginCredentials(const String& username, const String& password)
 {
-    if (is<HTMLInputElement>(m_assistedNode.get())) {
-        if (auto autofillElements = AutofillElements::computeAutofillElements(downcast<HTMLInputElement>(*m_assistedNode)))
+    if (is<HTMLInputElement>(m_focusedElement.get())) {
+        if (auto autofillElements = AutofillElements::computeAutofillElements(downcast<HTMLInputElement>(*m_focusedElement)))
             autofillElements->autofill(username, password);
     }
 }