WebKit Bugzilla
Attachment 357819 Details for
Bug 192936
: [iOS] Replace "node assistance" terminology in WebKit with "focused element"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192936-20181220094000.patch (text/plain), 199.63 KB, created by
Wenson Hsieh
on 2018-12-20 09:40:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-12-20 09:40:01 PST
Size:
199.63 KB
patch
obsolete
>Subversion Revision: 239441 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 59e23fb6db9a17b73d82e80760cda77c6b615add..2a9d7114fd6c68e05141d71d5de2af98eff83bda 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -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 NOBODY (OOPS!). >+ >+ 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 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Focusing an editable element should scroll to reveal the selection >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.cpp b/Source/WebKit/Shared/AssistedNodeInformation.cpp >deleted file mode 100644 >index dde4bec3728e3506851b59e47975a5ed1d6bcc16..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Shared/AssistedNodeInformation.cpp >+++ /dev/null >@@ -1,234 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "AssistedNodeInformation.h" >- >-#include "WebCoreArgumentCoders.h" >- >-namespace WebKit { >- >-#if PLATFORM(IOS_FAMILY) >-void OptionItem::encode(IPC::Encoder& encoder) const >-{ >- encoder << text; >- encoder << isGroup; >- encoder << isSelected; >- encoder << disabled; >- encoder << parentGroupID; >-} >- >-Optional<OptionItem> OptionItem::decode(IPC::Decoder& decoder) >-{ >- OptionItem result; >- if (!decoder.decode(result.text)) >- return WTF::nullopt; >- >- if (!decoder.decode(result.isGroup)) >- return WTF::nullopt; >- >- if (!decoder.decode(result.isSelected)) >- return WTF::nullopt; >- >- if (!decoder.decode(result.disabled)) >- return WTF::nullopt; >- >- if (!decoder.decode(result.parentGroupID)) >- return WTF::nullopt; >- >- return WTFMove(result); >-} >- >-void AssistedNodeInformation::encode(IPC::Encoder& encoder) const >-{ >- encoder << elementRect; >- encoder << elementInteractionLocation; >- encoder << minimumScaleFactor; >- encoder << maximumScaleFactor; >- encoder << maximumScaleFactorIgnoringAlwaysScalable; >- encoder << nodeFontSize; >- encoder << hasNextNode; >- encoder << nextNodeRect; >- encoder << hasPreviousNode; >- encoder << previousNodeRect; >- encoder << isAutocorrect; >- encoder << isRTL; >- encoder.encodeEnum(autocapitalizeType); >- encoder.encodeEnum(elementType); >- encoder.encodeEnum(inputMode); >- encoder << formAction; >- encoder << selectOptions; >- encoder << selectedIndex; >- encoder << isMultiSelect; >- encoder << isReadOnly; >- encoder << allowsUserScaling; >- encoder << allowsUserScalingIgnoringAlwaysScalable; >- encoder << insideFixedPosition; >- encoder << value; >- encoder << valueAsNumber; >- encoder << title; >- encoder << acceptsAutofilledLoginCredentials; >- encoder << isAutofillableUsernameField; >- encoder << elementIsTransparent; >- encoder << representingPageURL; >- encoder.encodeEnum(autofillFieldName); >- encoder << placeholder; >- encoder << label; >- encoder << ariaLabel; >- encoder << embeddedViewID; >- encoder << assistedNodeIdentifier; >-#if ENABLE(DATALIST_ELEMENT) >- encoder << hasSuggestions; >-#if ENABLE(INPUT_TYPE_COLOR) >- encoder << suggestedColors; >-#endif >-#endif >-} >- >-bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformation& result) >-{ >- if (!decoder.decode(result.elementRect)) >- return false; >- >- if (!decoder.decode(result.elementInteractionLocation)) >- return false; >- >- if (!decoder.decode(result.minimumScaleFactor)) >- return false; >- >- if (!decoder.decode(result.maximumScaleFactor)) >- return false; >- >- if (!decoder.decode(result.maximumScaleFactorIgnoringAlwaysScalable)) >- return false; >- >- if (!decoder.decode(result.nodeFontSize)) >- return false; >- >- if (!decoder.decode(result.hasNextNode)) >- return false; >- >- if (!decoder.decode(result.nextNodeRect)) >- return false; >- >- if (!decoder.decode(result.hasPreviousNode)) >- return false; >- >- if (!decoder.decode(result.previousNodeRect)) >- return false; >- >- if (!decoder.decode(result.isAutocorrect)) >- return false; >- >- if (!decoder.decode(result.isRTL)) >- return false; >- >- if (!decoder.decodeEnum(result.autocapitalizeType)) >- return false; >- >- if (!decoder.decodeEnum(result.elementType)) >- return false; >- >- if (!decoder.decodeEnum(result.inputMode)) >- return false; >- >- if (!decoder.decode(result.formAction)) >- return false; >- >- if (!decoder.decode(result.selectOptions)) >- return false; >- >- if (!decoder.decode(result.selectedIndex)) >- return false; >- >- if (!decoder.decode(result.isMultiSelect)) >- return false; >- >- if (!decoder.decode(result.isReadOnly)) >- return false; >- >- if (!decoder.decode(result.allowsUserScaling)) >- return false; >- >- if (!decoder.decode(result.allowsUserScalingIgnoringAlwaysScalable)) >- return false; >- >- if (!decoder.decode(result.insideFixedPosition)) >- return false; >- >- if (!decoder.decode(result.value)) >- return false; >- >- if (!decoder.decode(result.valueAsNumber)) >- return false; >- >- if (!decoder.decode(result.title)) >- return false; >- >- if (!decoder.decode(result.acceptsAutofilledLoginCredentials)) >- return false; >- >- if (!decoder.decode(result.isAutofillableUsernameField)) >- return false; >- >- if (!decoder.decode(result.elementIsTransparent)) >- return false; >- >- if (!decoder.decode(result.representingPageURL)) >- return false; >- >- if (!decoder.decodeEnum(result.autofillFieldName)) >- return false; >- >- if (!decoder.decode(result.placeholder)) >- return false; >- >- if (!decoder.decode(result.label)) >- return false; >- >- if (!decoder.decode(result.ariaLabel)) >- return false; >- >- if (!decoder.decode(result.embeddedViewID)) >- return false; >- >- if (!decoder.decode(result.assistedNodeIdentifier)) >- return false; >- >-#if ENABLE(DATALIST_ELEMENT) >- if (!decoder.decode(result.hasSuggestions)) >- return false; >- >-#if ENABLE(INPUT_TYPE_COLOR) >- if (!decoder.decode(result.suggestedColors)) >- return false; >-#endif >-#endif >- >- return true; >-} >-#endif >- >-} >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.h b/Source/WebKit/Shared/AssistedNodeInformation.h >deleted file mode 100644 >index c247f89043ee7504751b619ffeabf4269bb54a29..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Shared/AssistedNodeInformation.h >+++ /dev/null >@@ -1,146 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "ArgumentCoders.h" >-#include <WebCore/AutocapitalizeTypes.h> >-#include <WebCore/Autofill.h> >-#include <WebCore/Color.h> >-#include <WebCore/GraphicsLayer.h> >-#include <WebCore/InputMode.h> >-#include <WebCore/IntRect.h> >-#include <wtf/URL.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebKit { >- >-enum class InputType { >- None, >- ContentEditable, >- Text, >- Password, >- TextArea, >- Search, >- Email, >- URL, >- Phone, >- Number, >- NumberPad, >- Date, >- DateTime, >- DateTimeLocal, >- Month, >- Week, >- Time, >- Select, >- Drawing, >-#if ENABLE(INPUT_TYPE_COLOR) >- Color >-#endif >-}; >- >-#if PLATFORM(IOS_FAMILY) >-struct OptionItem { >- OptionItem() { } >- >- OptionItem(const OptionItem& item) >- : text(item.text) >- , isGroup(item.isGroup) >- , isSelected(item.isSelected) >- , disabled(item.disabled) >- , parentGroupID(item.parentGroupID) >- { >- } >- >- OptionItem(const String& text, bool isGroup, int parentID, bool selected, bool disabled) >- : text(text) >- , isGroup(isGroup) >- , isSelected(selected) >- , disabled(disabled) >- , parentGroupID(parentID) >- { >- } >- String text; >- bool isGroup { false }; >- bool isSelected { false }; >- bool disabled { false }; >- int parentGroupID { 0 }; >- >- void encode(IPC::Encoder&) const; >- static Optional<OptionItem> decode(IPC::Decoder&); >-}; >- >-struct AssistedNodeInformation { >- WebCore::IntRect elementRect; >- WebCore::IntPoint elementInteractionLocation; >- double minimumScaleFactor { -INFINITY }; >- double maximumScaleFactor { INFINITY }; >- double maximumScaleFactorIgnoringAlwaysScalable { INFINITY }; >- double nodeFontSize { 0 }; >- bool hasNextNode { false }; >- WebCore::IntRect nextNodeRect; >- bool hasPreviousNode { false }; >- WebCore::IntRect previousNodeRect; >- bool isAutocorrect { false }; >- bool isRTL { false }; >- bool isMultiSelect { false }; >- bool isReadOnly {false }; >- bool allowsUserScaling { false }; >- bool allowsUserScalingIgnoringAlwaysScalable { false }; >- bool insideFixedPosition { false }; >- AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault }; >- InputType elementType { InputType::None }; >- WebCore::InputMode inputMode { WebCore::InputMode::Unspecified }; >- String formAction; >- Vector<OptionItem> selectOptions; >- int selectedIndex { -1 }; >- String value; >- double valueAsNumber { 0 }; >- String title; >- bool acceptsAutofilledLoginCredentials { false }; >- bool isAutofillableUsernameField { false }; >- bool elementIsTransparent { false }; >- URL representingPageURL; >- WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None }; >- String placeholder; >- String label; >- String ariaLabel; >- WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID; >-#if ENABLE(DATALIST_ELEMENT) >- bool hasSuggestions { false }; >-#if ENABLE(INPUT_TYPE_COLOR) >- Vector<WebCore::Color> suggestedColors; >-#endif >-#endif >- >- uint64_t assistedNodeIdentifier { 0 }; >- >- void encode(IPC::Encoder&) const; >- static bool decode(IPC::Decoder&, AssistedNodeInformation&); >-}; >-#endif >- >-} >diff --git a/Source/WebKit/Shared/FocusedElementInformation.cpp b/Source/WebKit/Shared/FocusedElementInformation.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..159d7493bb61ce5dec1eb353d87166ef81d00358 >--- /dev/null >+++ b/Source/WebKit/Shared/FocusedElementInformation.cpp >@@ -0,0 +1,234 @@ >+/* >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "FocusedElementInformation.h" >+ >+#include "WebCoreArgumentCoders.h" >+ >+namespace WebKit { >+ >+#if PLATFORM(IOS_FAMILY) >+void OptionItem::encode(IPC::Encoder& encoder) const >+{ >+ encoder << text; >+ encoder << isGroup; >+ encoder << isSelected; >+ encoder << disabled; >+ encoder << parentGroupID; >+} >+ >+Optional<OptionItem> OptionItem::decode(IPC::Decoder& decoder) >+{ >+ OptionItem result; >+ if (!decoder.decode(result.text)) >+ return WTF::nullopt; >+ >+ if (!decoder.decode(result.isGroup)) >+ return WTF::nullopt; >+ >+ if (!decoder.decode(result.isSelected)) >+ return WTF::nullopt; >+ >+ if (!decoder.decode(result.disabled)) >+ return WTF::nullopt; >+ >+ if (!decoder.decode(result.parentGroupID)) >+ return WTF::nullopt; >+ >+ return WTFMove(result); >+} >+ >+void FocusedElementInformation::encode(IPC::Encoder& encoder) const >+{ >+ encoder << elementRect; >+ encoder << elementInteractionLocation; >+ encoder << minimumScaleFactor; >+ encoder << maximumScaleFactor; >+ encoder << maximumScaleFactorIgnoringAlwaysScalable; >+ encoder << nodeFontSize; >+ encoder << hasNextNode; >+ encoder << nextNodeRect; >+ encoder << hasPreviousNode; >+ encoder << previousNodeRect; >+ encoder << isAutocorrect; >+ encoder << isRTL; >+ encoder.encodeEnum(autocapitalizeType); >+ encoder.encodeEnum(elementType); >+ encoder.encodeEnum(inputMode); >+ encoder << formAction; >+ encoder << selectOptions; >+ encoder << selectedIndex; >+ encoder << isMultiSelect; >+ encoder << isReadOnly; >+ encoder << allowsUserScaling; >+ encoder << allowsUserScalingIgnoringAlwaysScalable; >+ encoder << insideFixedPosition; >+ encoder << value; >+ encoder << valueAsNumber; >+ encoder << title; >+ encoder << acceptsAutofilledLoginCredentials; >+ encoder << isAutofillableUsernameField; >+ encoder << elementIsTransparent; >+ encoder << representingPageURL; >+ encoder.encodeEnum(autofillFieldName); >+ encoder << placeholder; >+ encoder << label; >+ encoder << ariaLabel; >+ encoder << embeddedViewID; >+ encoder << focusedElementIdentifier; >+#if ENABLE(DATALIST_ELEMENT) >+ encoder << hasSuggestions; >+#if ENABLE(INPUT_TYPE_COLOR) >+ encoder << suggestedColors; >+#endif >+#endif >+} >+ >+bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInformation& result) >+{ >+ if (!decoder.decode(result.elementRect)) >+ return false; >+ >+ if (!decoder.decode(result.elementInteractionLocation)) >+ return false; >+ >+ if (!decoder.decode(result.minimumScaleFactor)) >+ return false; >+ >+ if (!decoder.decode(result.maximumScaleFactor)) >+ return false; >+ >+ if (!decoder.decode(result.maximumScaleFactorIgnoringAlwaysScalable)) >+ return false; >+ >+ if (!decoder.decode(result.nodeFontSize)) >+ return false; >+ >+ if (!decoder.decode(result.hasNextNode)) >+ return false; >+ >+ if (!decoder.decode(result.nextNodeRect)) >+ return false; >+ >+ if (!decoder.decode(result.hasPreviousNode)) >+ return false; >+ >+ if (!decoder.decode(result.previousNodeRect)) >+ return false; >+ >+ if (!decoder.decode(result.isAutocorrect)) >+ return false; >+ >+ if (!decoder.decode(result.isRTL)) >+ return false; >+ >+ if (!decoder.decodeEnum(result.autocapitalizeType)) >+ return false; >+ >+ if (!decoder.decodeEnum(result.elementType)) >+ return false; >+ >+ if (!decoder.decodeEnum(result.inputMode)) >+ return false; >+ >+ if (!decoder.decode(result.formAction)) >+ return false; >+ >+ if (!decoder.decode(result.selectOptions)) >+ return false; >+ >+ if (!decoder.decode(result.selectedIndex)) >+ return false; >+ >+ if (!decoder.decode(result.isMultiSelect)) >+ return false; >+ >+ if (!decoder.decode(result.isReadOnly)) >+ return false; >+ >+ if (!decoder.decode(result.allowsUserScaling)) >+ return false; >+ >+ if (!decoder.decode(result.allowsUserScalingIgnoringAlwaysScalable)) >+ return false; >+ >+ if (!decoder.decode(result.insideFixedPosition)) >+ return false; >+ >+ if (!decoder.decode(result.value)) >+ return false; >+ >+ if (!decoder.decode(result.valueAsNumber)) >+ return false; >+ >+ if (!decoder.decode(result.title)) >+ return false; >+ >+ if (!decoder.decode(result.acceptsAutofilledLoginCredentials)) >+ return false; >+ >+ if (!decoder.decode(result.isAutofillableUsernameField)) >+ return false; >+ >+ if (!decoder.decode(result.elementIsTransparent)) >+ return false; >+ >+ if (!decoder.decode(result.representingPageURL)) >+ return false; >+ >+ if (!decoder.decodeEnum(result.autofillFieldName)) >+ return false; >+ >+ if (!decoder.decode(result.placeholder)) >+ return false; >+ >+ if (!decoder.decode(result.label)) >+ return false; >+ >+ if (!decoder.decode(result.ariaLabel)) >+ return false; >+ >+ if (!decoder.decode(result.embeddedViewID)) >+ return false; >+ >+ if (!decoder.decode(result.focusedElementIdentifier)) >+ return false; >+ >+#if ENABLE(DATALIST_ELEMENT) >+ if (!decoder.decode(result.hasSuggestions)) >+ return false; >+ >+#if ENABLE(INPUT_TYPE_COLOR) >+ if (!decoder.decode(result.suggestedColors)) >+ return false; >+#endif >+#endif >+ >+ return true; >+} >+#endif >+ >+} >diff --git a/Source/WebKit/Shared/FocusedElementInformation.h b/Source/WebKit/Shared/FocusedElementInformation.h >new file mode 100644 >index 0000000000000000000000000000000000000000..fee43062f159f40f451eef10deffc1cd665dacc6 >--- /dev/null >+++ b/Source/WebKit/Shared/FocusedElementInformation.h >@@ -0,0 +1,148 @@ >+/* >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "ArgumentCoders.h" >+#include <WebCore/AutocapitalizeTypes.h> >+#include <WebCore/Autofill.h> >+#include <WebCore/Color.h> >+#include <WebCore/GraphicsLayer.h> >+#include <WebCore/InputMode.h> >+#include <WebCore/IntRect.h> >+#include <wtf/URL.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebKit { >+ >+enum class InputType { >+ None, >+ ContentEditable, >+ Text, >+ Password, >+ TextArea, >+ Search, >+ Email, >+ URL, >+ Phone, >+ Number, >+ NumberPad, >+ Date, >+ DateTime, >+ DateTimeLocal, >+ Month, >+ Week, >+ Time, >+ Select, >+ Drawing, >+#if ENABLE(INPUT_TYPE_COLOR) >+ Color >+#endif >+}; >+ >+#if PLATFORM(IOS_FAMILY) >+struct OptionItem { >+ OptionItem() { } >+ >+ OptionItem(const OptionItem& item) >+ : text(item.text) >+ , isGroup(item.isGroup) >+ , isSelected(item.isSelected) >+ , disabled(item.disabled) >+ , parentGroupID(item.parentGroupID) >+ { >+ } >+ >+ OptionItem(const String& text, bool isGroup, int parentID, bool selected, bool disabled) >+ : text(text) >+ , isGroup(isGroup) >+ , isSelected(selected) >+ , disabled(disabled) >+ , parentGroupID(parentID) >+ { >+ } >+ String text; >+ bool isGroup { false }; >+ bool isSelected { false }; >+ bool disabled { false }; >+ int parentGroupID { 0 }; >+ >+ void encode(IPC::Encoder&) const; >+ static Optional<OptionItem> decode(IPC::Decoder&); >+}; >+ >+using FocusedElementIdentifier = uint64_t; >+ >+struct FocusedElementInformation { >+ WebCore::IntRect elementRect; >+ WebCore::IntPoint elementInteractionLocation; >+ double minimumScaleFactor { -INFINITY }; >+ double maximumScaleFactor { INFINITY }; >+ double maximumScaleFactorIgnoringAlwaysScalable { INFINITY }; >+ double nodeFontSize { 0 }; >+ bool hasNextNode { false }; >+ WebCore::IntRect nextNodeRect; >+ bool hasPreviousNode { false }; >+ WebCore::IntRect previousNodeRect; >+ bool isAutocorrect { false }; >+ bool isRTL { false }; >+ bool isMultiSelect { false }; >+ bool isReadOnly {false }; >+ bool allowsUserScaling { false }; >+ bool allowsUserScalingIgnoringAlwaysScalable { false }; >+ bool insideFixedPosition { false }; >+ AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault }; >+ InputType elementType { InputType::None }; >+ WebCore::InputMode inputMode { WebCore::InputMode::Unspecified }; >+ String formAction; >+ Vector<OptionItem> selectOptions; >+ int selectedIndex { -1 }; >+ String value; >+ double valueAsNumber { 0 }; >+ String title; >+ bool acceptsAutofilledLoginCredentials { false }; >+ bool isAutofillableUsernameField { false }; >+ bool elementIsTransparent { false }; >+ URL representingPageURL; >+ WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None }; >+ String placeholder; >+ String label; >+ String ariaLabel; >+ WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID; >+#if ENABLE(DATALIST_ELEMENT) >+ bool hasSuggestions { false }; >+#if ENABLE(INPUT_TYPE_COLOR) >+ Vector<WebCore::Color> suggestedColors; >+#endif >+#endif >+ >+ FocusedElementIdentifier focusedElementIdentifier { 0 }; >+ >+ void encode(IPC::Encoder&) const; >+ static bool decode(IPC::Decoder&, FocusedElementInformation&); >+}; >+#endif >+ >+} >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >index 4a30abfe2ea11fc2000a819fddf12ed423d08551..71bce803c8f4d2c29d135db79e7d9aaf15d45b68 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >@@ -41,7 +41,7 @@ namespace WebKit { > struct InteractionInformationAtPosition { > InteractionInformationRequest request; > >- bool nodeAtPositionIsAssistedNode { false }; >+ bool nodeAtPositionIsFocusedElement { false }; > #if ENABLE(DATA_INTERACTION) > bool hasSelectionAtPosition { false }; > #endif >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >index fd703104869411b1203f3c86ea26ee56c5562541..acda81915bcd80aed92f3986aa01c273100828cd 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >@@ -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) >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index ed65b8fa739e8e1960b3dce6b864e5145e2f9183..9d7cc5cc6c4e71c4bc63cd1fbf3424df47a3fc4c 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -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 > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 3d3c1edd76775ec9ca91e98d001c7c3a0081b231..b2d33c44f4198128cec6fa70836c5f5b92c921b5 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -3151,7 +3151,7 @@ - (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:( > > - (BOOL)_shouldUpdateKeyboardWithInfo:(NSDictionary *)keyboardInfo > { >- if ([_contentView isAssistingNode]) >+ if ([_contentView isFocusingElement]) > return YES; > > NSNumber *isLocalKeyboard = [keyboardInfo valueForKey:UIKeyboardIsLocalUserInfoKey]; >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index bed6d18f9938b415cdfe71fe4a151a272a7a793b..c722b7d7066812c749d727cb7f8dd4b95204de52 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -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; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 4b01252ebb8fe927c5aaf4c570da8e455f8ecb6d..f66f73dfb311e77b5cb168e5a2c1f1cb4849fc7c 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -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 > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index ca5104885a46cef301ee6ab1f36bec81e3de62cb..156f144aa41bcf90b58e2ffd3f2698cd9c464916 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -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; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index b11fcb1d6a968a5cce72a4d84af9d06658a017e3..1e4518f71c41fd1e628886fc03e3512f018aa1c9 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -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() >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index 157a31082f46997b323cc347f03e0aa92cf842df..a8e1d6a36094a3d8e205f3a7dfda46787fbbab8c 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -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; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index b8a6fe7dfddc18c1bc4901829ec505c8507d495c..e929e20dc16e5bb5f63566afdd1c69ca89c63a62 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -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() >diff --git a/Source/WebKit/UIProcess/ios/WKContentView.h b/Source/WebKit/UIProcess/ios/WKContentView.h >index 687a20b213e35f60d1b56f2f73460e6cdf2b07c7..11fd8a040ff98fb30d2388944a44261bdda6a355 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentView.h >+++ b/Source/WebKit/UIProcess/ios/WKContentView.h >@@ -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; >diff --git a/Source/WebKit/UIProcess/ios/WKContentView.mm b/Source/WebKit/UIProcess/ios/WKContentView.mm >index 6afbcb82bd15be3a6f62646abc7fb67476ec45ba..eb2aed54d3000080575acd63e56aa8f8482244ea 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentView.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentView.mm >@@ -300,7 +300,7 @@ - (WKPageRef)_pageRef > return toAPI(_page.get()); > } > >-- (BOOL)isAssistingNode >+- (BOOL)isFocusingElement > { > return [self isEditable]; > } >@@ -544,7 +544,7 @@ - (void)_didRelaunchProcess > > - (void)_didCommitLoadForMainFrame > { >- [self _stopAssistingNode]; >+ [self _elementDidBlur]; > [self _cancelLongPressGestureRecognizer]; > [_webView _didCommitLoadForMainFrame]; > } >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index 4d8c1406a33507d85c08d1f67b64f84624ec0b0e..c1f647402d9abe26168152c1e7101287d61bb199 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -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; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 5e399fd105e3c6506a0f5b61164ebc613fbe4faa..f269395061f20a2ab9cf26a8e01bd5e7854c1c7a 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -281,7 +281,7 @@ @end > @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 @@ @implementation WKFocusedElementInfo { > 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 @@ @end > > @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 @@ - (void)cleanupInteraction > #endif > > _inputViewUpdateDeferrer = nullptr; >- _assistedNodeInformation = { }; >+ _focusedElementInformation = { }; > > [_keyboardScrollingAnimator invalidate]; > _keyboardScrollingAnimator = nil; >@@ -1008,7 +1008,7 @@ - (CGPoint)lastInteractionLocation > - (BOOL)shouldHideSelectionWhenScrolling > { > if (_isEditable) >- return _assistedNodeInformation.insideFixedPosition; >+ return _focusedElementInformation.insideFixedPosition; > > auto& editorState = _page->editorState(); > return !editorState.isMissingPostLayoutData && editorState.postLayoutData().insideFixedPosition; >@@ -1090,7 +1090,7 @@ - (BOOL)resignFirstResponderForWebView > 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 @@ - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore:: > if (!_isTapHighlightIDValid || _latestTapID != requestID) > return; > >- if (hasAssistedNode(_assistedNodeInformation) && _positionInformation.nodeAtPositionIsAssistedNode) >+ if (hasFocusedElement(_focusedElementInformation) && _positionInformation.nodeAtPositionIsFocusedElement) > return; > > _isTapHighlightIDValid = NO; >@@ -1372,7 +1372,7 @@ - (void)_scrollingNodeScrollingDidEnd > - (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 @@ - (BOOL)_requiresKeyboardWhenFirstResponder > case WebKit::InputType::Time: > return !currentUserInterfaceIdiomIsPad(); > default: >- return !_assistedNodeInformation.isReadOnly; >+ return !_focusedElementInformation.isReadOnly; > } > return NO; > } >@@ -1404,26 +1404,26 @@ - (void)_zoomToRevealFocusedElement > 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 @@ - (UIView *)inputView > > - (CGRect)_selectionClipRect > { >- if (!hasAssistedNode(_assistedNodeInformation)) >+ if (!hasFocusedElement(_focusedElementInformation)) > return CGRectNull; > return _page->editorState().postLayoutData().selectionClipRect; > } >@@ -1725,18 +1725,18 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer > || 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 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer > 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 @@ - (BOOL)textInteractionGesture:(UIWKGestureType)gesture shouldBeginAtPoint:(CGPo > #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 @@ - (void)setUpTextSelectionAssistant > > - (void)clearSelection > { >- [self _stopAssistingNode]; >+ [self _elementDidBlur]; > _page->clearSelection(); > } > >@@ -2198,10 +2198,10 @@ - (BOOL)requiresAccessoryView > 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 @@ - (BOOL)canPerformAction:(SEL)action withSender:(id)sender > - (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 @@ - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType > - (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 @@ - (void)selectPositionAtPoint:(CGPoint)point completionHandler:(void (^)(void))c > 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 @@ - (void)selectPositionAtBoundary:(UITextGranularity)granularity inDirection:(UIT > 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 @@ - (void)selectTextWithGranularity:(UITextGranularity)granularity atPoint:(CGPoin > 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 @@ - (void)updateSelectionWithExtentPoint:(CGPoint)point completionHandler:(void (^ > { > 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 @@ - (void)updateSelectionWithExtentPoint:(CGPoint)point withBoundary:(UITextGranul > { > 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 @@ - (void)accessoryTab:(BOOL)isNext > _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 @@ - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward c > 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 @@ - (void)accessoryAutoFill > > - (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 @@ - (void)insertTextSuggestion:(UITextSuggestion *)textSuggestion > } > #if ENABLE(DATALIST_ELEMENT) > if ([textSuggestion isKindOfClass:[WKDataListTextSuggestion class]]) { >- _page->setAssistedNodeValue([textSuggestion inputText]); >+ _page->setFocusedElementValue([textSuggestion inputText]); > return; > } > #endif >@@ -3530,7 +3530,7 @@ - (void)setSelectedTextRange:(UITextRange *)range > if (range) > return; > #if !PLATFORM(IOSMAC) >- if (!hasAssistedNode(_assistedNodeInformation)) >+ if (!hasFocusedElement(_focusedElementInformation)) > return; > #endif > [self clearSelection]; >@@ -3806,23 +3806,23 @@ - (UITextInputTraits *)textInputTraits > 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 @@ - (UITextInputTraits *)textInputTraits > break; > } > >- [_traits setTextContentType:contentTypeFromFieldName(_assistedNodeInformation.autofillFieldName)]; >+ [_traits setTextContentType:contentTypeFromFieldName(_focusedElementInformation.autofillFieldName)]; > > [self _updateInteractionTintColor]; > >@@ -4082,7 +4082,7 @@ - (BOOL)isScrollableForKeyboardScrollViewAnimator:(WKKeyboardScrollViewAnimator > 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 @@ - (void)_stopAssistingKeyboard > [_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 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > } > > if (blurPreviousNode) >- [self _stopAssistingNode]; >+ [self _elementDidBlur]; > > #if HAVE(PENCILKIT) > if (information.elementType == WebKit::InputType::Drawing) >@@ -4514,9 +4514,9 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > 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 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > [inputDelegate _webView:_webView willStartInputSession:_formInputSession.get()]; > > BOOL editableChanged = [self setIsEditable:YES]; >- _assistedNodeInformation = information; >+ _focusedElementInformation = information; > _inputPeripheral = nil; > _traits = nil; > >@@ -4547,7 +4547,7 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > #if PLATFORM(WATCHOS) > [self addFocusedFormControlOverlay]; > if (!_isChangingFocus) >- [self presentViewControllerForCurrentAssistedNode]; >+ [self presentViewControllerForCurrentFocusedElement]; > #else > [self reloadInputViews]; > #endif >@@ -4568,11 +4568,11 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > 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 @@ - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information > [_webView didStartFormControlInteraction]; > } > >-- (void)_stopAssistingNode >+- (void)_elementDidBlur > { > SetForScope<BOOL> isBlurringFocusedNodeForScope { _isBlurringFocusedNode, YES }; > >@@ -4611,7 +4611,7 @@ - (void)_stopAssistingNode > > BOOL editableChanged = [self setIsEditable:NO]; > >- _assistedNodeInformation.elementType = WebKit::InputType::None; >+ _focusedElementInformation.elementType = WebKit::InputType::None; > _inputPeripheral = nil; > _focusRequiresStrongPasswordAssistance = NO; > >@@ -4626,7 +4626,7 @@ - (void)_stopAssistingNode > [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 @@ - (void)_didReceiveEditorStateUpdateAfterFocus > > // 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 @@ - (void)_updateInitialWritingDirectionIfNecessary > [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 @@ - (void)removeFocusedFormControlOverlay > [self setInputDelegate:nil]; > } > >-- (void)presentViewControllerForCurrentAssistedNode >+- (void)presentViewControllerForCurrentFocusedElement > { > [self dismissAllInputViewControllers:NO]; > >@@ -4728,7 +4728,7 @@ - (void)presentViewControllerForCurrentAssistedNode > > BOOL prefersModalPresentation = NO; > >- switch (_assistedNodeInformation.elementType) { >+ switch (_focusedElementInformation.elementType) { > case WebKit::InputType::Select: > _presentedFullScreenInputViewController = adoptNS([[WKSelectMenuListViewController alloc] initWithDelegate:self]); > break; >@@ -4808,45 +4808,45 @@ - (void)dismissAllInputViewControllers:(BOOL)animated > - (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 @@ - (UIScrollView *)scrollViewForFocusedFormControlView:(WKFocusedFormControlView > > - (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 @@ - (NSString *)actionNameForFocusedFormControlView:(WKFocusedFormControlView *)vi > > - (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 @@ - (void)focusedFormControllerDidUpdateSuggestions:(WKFocusedFormControlView *)vi > > - (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 @@ - (NSString *)selectMenu:(WKSelectMenuListViewController *)selectMenu displayTex > > - (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 @@ - (void)_updateChangedSelection:(BOOL)force > return; > > auto& postLayoutData = state.postLayoutData(); >- if (hasAssistedNode(_assistedNodeInformation)) { >+ if (hasFocusedElement(_focusedElementInformation)) { > if (postLayoutData.elementIsTransparent) > [self _beginSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTransparent]; > else >@@ -5744,14 +5744,14 @@ - (NSArray<UIDragItem *> *)_itemsForBeginningOrAddingToSessionWithRegistrationLi > > - (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 @@ - (void)dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:(P > 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 @@ - (void)dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:(P > [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 @@ - (CGFloat)viewController:(PUICQuickboardViewController *)controller inputContex > > - (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 @@ - (UIView *)inputContextViewForViewController:(PUICQuickboardViewController *)co > > - (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 @@ - (BOOL)shouldDisplayInputContextViewForListViewController:(PUICQuickboardViewCo > > - (WKNumberPadInputMode)numericInputModeForListViewController:(WKTextInputListViewController *)controller > { >- switch (_assistedNodeInformation.elementType) { >+ switch (_focusedElementInformation.elementType) { > case WebKit::InputType::Phone: > return WKNumberPadInputModeTelephone; > case WebKit::InputType::Number: >@@ -6222,7 +6222,7 @@ - (WKNumberPadInputMode)numericInputModeForListViewController:(WKTextInputListVi > > - (NSString *)textContentTypeForListViewController:(WKTextInputListViewController *)controller > { >- switch (_assistedNodeInformation.elementType) { >+ switch (_focusedElementInformation.elementType) { > case WebKit::InputType::Password: > return UITextContentTypePassword; > case WebKit::InputType::URL: >@@ -6233,10 +6233,10 @@ - (NSString *)textContentTypeForListViewController:(WKTextInputListViewControlle > 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 @@ - (void)listViewController:(WKTextInputListViewController *)controller didSelect > > - (BOOL)allowsDictationInputForListViewController:(PUICQuickboardViewController *)controller > { >- return _assistedNodeInformation.elementType != WebKit::InputType::Password; >+ return _focusedElementInformation.elementType != WebKit::InputType::Password; > } > > #endif // PLATFORM(WATCHOS) >diff --git a/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm b/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm >index 6f07d893af591b3649b34e6c8edca77d3aa5138d..7b38833fbeffcde7730d0129d833e879b54059c6 100644 >--- a/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm >@@ -190,7 +190,7 @@ - (String)suggestionAtIndex:(NSInteger)index > > - (NSTextAlignment)textAlignment > { >- return _view.assistedNodeInformation.isRTL ? NSTextAlignmentRight : NSTextAlignmentLeft; >+ return _view.focusedElementInformation.isRTL ? NSTextAlignmentRight : NSTextAlignmentLeft; > } > > @end >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index 68aa2b1015c0dcebbd25523401a754b3f25d3b23..f6d304b81061b5ad418806bd89d6b767af4dbbc2 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -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&) >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm b/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm >index 34b4f8d1e86af4863ee8983149a92a32ad92db55..daac90aa0f8b5d642f627c8e8c27604397b3e2ef 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm >@@ -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 @@ - (instancetype)initWithView:(WKContentView *)view > 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 @@ - (void)drawSelectionIndicatorForColorButton:(WKColorButton *)colorButton > - (void)setControlValueFromUIColor:(UIColor *)uiColor > { > WebCore::Color color(uiColor.CGColor); >- [_view page]->setAssistedNodeValue(color.serialized()); >+ [_view page]->setFocusedElementValue(color.serialized()); > } > > #pragma mark WKFormControl >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm b/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm >index 2bb02ca67eb8eb84d1a0fb77677f70ebb8e7551c..98e14678e17d46da99459f5b6d1d054e80d50459 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm >@@ -87,7 +87,7 @@ - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode > _view = view; > _shouldRemoveTimeZoneInformation = NO; > _isTimeInput = NO; >- switch (view.assistedNodeInformation.elementType) { >+ switch (view.focusedElementInformation.elementType) { > case InputType::Date: > _formatString = kDateFormatString; > break; >@@ -111,7 +111,7 @@ - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode > _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 @@ - (void)dealloc > [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 @@ - (NSString *)_sanitizeInputValueForFormatter:(NSString *)value > - (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 @@ - (void)_dateChangedSetAsString > // 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 @@ - (void)controlBeginEditing > > // 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 @@ - (void)controlBeginEditing > } > > // 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 @@ - (instancetype)initWithView:(WKContentView *)view > > UIDatePickerMode mode; > >- switch (view.assistedNodeInformation.elementType) { >+ switch (view.focusedElementInformation.elementType) { > case InputType::Date: > mode = UIDatePickerModeDate; > break; >@@ -334,7 +334,7 @@ @implementation WKDateTimePopover > > - (void)clear:(id)sender > { >- [_view page]->setAssistedNodeValue(String()); >+ [_view page]->setFocusedElementValue(String()); > } > > - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode >@@ -349,7 +349,7 @@ - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode > 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()]); >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormPopover.mm b/Source/WebKit/UIProcess/ios/forms/WKFormPopover.mm >index 99ff72b1e2ebe911d8f3ac907d6ad7b56e07ff1c..07eee03ca6dc934ab579793990a38a24bc9840e7 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormPopover.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormPopover.mm >@@ -142,7 +142,7 @@ - (void)presentPopoverAnimated:(BOOL)animated > permittedArrowDirections:directions > animated:animated]; > } else { >- CGRect boundingBoxOfDOMNode = _view.assistedNodeInformation.elementRect; >+ CGRect boundingBoxOfDOMNode = _view.focusedElementInformation.elementRect; > [_popoverController presentPopoverFromRect:CGRectIntegral(boundingBoxOfDOMNode) > inView:_view > permittedArrowDirections:directions >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.h b/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.h >index 402520a20e7159594922574939cae4ef343f5905..7be651a804a896e90d61cd588e6294805f826242 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.h >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.h >@@ -25,7 +25,7 @@ > > #if PLATFORM(IOS_FAMILY) > >-#import "AssistedNodeInformation.h" >+#import "FocusedElementInformation.h" > #import "UIKitSPI.h" > #import "WKFormPeripheral.h" > #import "WKFormPopover.h" >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm b/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm >index 097865a1019bdb71eea157c99f698f43f020272a..3b948d1ad4db51ff12b2eb07943299c1a3112f8b 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm >@@ -69,8 +69,8 @@ - (instancetype)initWithView:(WKContentView *)view > 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 @@ - (instancetype)initWithView:(WKContentView *)view > > 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]); >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm b/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm >index da26bb30dac38a01f26ffc9d1b9f0ac33c22b3d4..520aa148b464f749d96c4802a0c65c9add76e452 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm >@@ -146,7 +146,7 @@ - (instancetype)initWithView:(WKContentView *)view > 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 @@ - (instancetype)initWithView:(WKContentView *)view > [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 @@ - (void)layoutSubviews > > - (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 @@ - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)rowIndex > 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 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)aPickerView > > - (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 @@ - (NSInteger)findItemIndexAt:(int)rowIndex > > - (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 @@ - (void)pickerView:(UIPickerView *)pickerView row:(int)rowIndex column:(int)colu > } > > 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 @@ - (void)pickerView:(UIPickerView *)pickerView row:(int)rowIndex column:(int)colu > // 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 @@ - (instancetype)initWithView:(WKContentView *)view > > _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 @@ - (void)controlEndEditing > 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 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView > > - (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 @@ - (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleFor > > - (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 @@ - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComp > > // 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; >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm b/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm >index 53c25d00b950b644c2d5186e7ebaef439aa3b474..f5b66715a078d9ef433e46d071aa9cb48fcfff26 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm >@@ -104,8 +104,8 @@ - (id)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups > 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 @@ - (id)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups > } > > 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 @@ - (id)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups > // 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 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView > > - (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 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInte > 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 @@ - (NSInteger)findItemIndexAt:(NSIndexPath *)indexPath > > 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 @@ - (OptionItem *)findItemAt:(NSIndexPath *)indexPath > 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 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N > 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 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N > 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 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N > > - (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 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath > // 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 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath > _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 @@ - (instancetype)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups > [_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; >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 03b1f2386222f882759a6c24a9a04fec9b41c268..2e9f0d8881a55f102c007174c2ece311228e2c89 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -1519,7 +1519,7 @@ > 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, ); }; }; >@@ -4322,8 +4322,8 @@ > 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>"; }; >@@ -5002,8 +5002,6 @@ > BC329D9916ACCE9900316DE2 /* APIWebArchive.mm */, > BC329D9F16ACD47800316DE2 /* APIWebArchiveResource.h */, > BC329D9E16ACD47800316DE2 /* APIWebArchiveResource.mm */, >- C59C4A5618B81174007BDCB6 /* AssistedNodeInformation.cpp */, >- C59C4A5718B81174007BDCB6 /* AssistedNodeInformation.h */, > 515E7725183DD6F60007203F /* AsyncRequest.cpp */, > 515E7726183DD6F60007203F /* AsyncRequest.h */, > E164A2EF191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.cpp */, >@@ -5024,6 +5022,8 @@ > E105FE5318D7B9DE008F57A8 /* EditingRange.h */, > 8CFECE931490F140002AAA32 /* EditorState.cpp */, > 1AA41AB412C02EC4002BE67B /* EditorState.h */, >+ C59C4A5618B81174007BDCB6 /* FocusedElementInformation.cpp */, >+ C59C4A5718B81174007BDCB6 /* FocusedElementInformation.h */, > BCE81D8A1319F7EF00241910 /* FontInfo.cpp */, > BCE81D8B1319F7EF00241910 /* FontInfo.h */, > 1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */, >@@ -8927,7 +8927,6 @@ > 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 */, >@@ -9002,6 +9001,7 @@ > 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 */, >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index bf6471449fbb81909081c8ddd7bf2da55bc8ee84..a3292aac95b050b13fe76c6bde59b35577d5b178 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -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() >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index c29bd4dc5824a58955dd77360e69cd11cc37b9ab..7f0443e5c6eb3582352e97fc3c95c4facadbbd9f 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -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; >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index a71cb0443c970e4430ffe426cb5d878c3348d7ba..fc4ea1dfb94264ca1b97bfd8965320e402e07111 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -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 }; >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index bc9e3ec085cfd2996d91832f7e40d3ec3b61bd42..e2654d943cf4c4f6b5e497eb792fb8d5d65cbbf4 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -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 > >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 9f99b4be5ce896a15b8e34f70f8904bee907e5e7..c1502acb46aba44ee8d5607fac84e9b0c299aa27 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -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); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192936
:
357819
|
357820