Title: [250345] trunk
Revision
250345
Author
[email protected]
Date
2019-09-25 09:01:38 -0700 (Wed, 25 Sep 2019)

Log Message

[iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
https://bugs.webkit.org/show_bug.cgi?id=202167
<rdar://problem/55185021>

Reviewed by Tim Horton.

Source/WebCore:

Adds a new site-specific quirk. See WebKit ChangeLog for more details.

* page/Quirks.cpp:
(WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):
* page/Quirks.h:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isDataActivation):

Source/WebKit:

When using the data activation page on www.att.com, one of the sections on the page contains several select
elements; in the case where the user agent:

1. contains the string "iPad", and
2. does not contain the string "Safari"

...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select
elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element
after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the
blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility
with screen readers.

In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation
would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div
element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the
focused select element when dismissing the popover. This means that the select element is only blurred the next
time the user activates another focused element, such as one of the input fields on the page, or a different
select element. Consequently, the logic to move focus into a div element now occurs only after a different
element has already been focused; this results in focus moving away from newly focused elements after 1 second
in the case where a select element has previously focused.

To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more
details.

* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:

Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select
popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well
as dismissing the popover with animation).

* Shared/WebPreferences.yaml:

Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for
site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes
various known bugs that are otherwise addressed in Safari only, via site-specific quirks.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to
false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the
default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the
web process is not necessarily linked against the same SDK as the application.

* UIProcess/Cocoa/VersionChecks.h:

Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by
default.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):

We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a
select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle
is "com.apple.DataActivation".

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController shouldDismissWithAnimation]):

Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior.

(-[WKSelectPopover controlEndEditing]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

Source/WTF:

Declare DYLD_IOS_VERSION_13_2.

* wtf/spi/darwin/dyldSPI.h:

Tools:

Rebaseline an API test.

* TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (250344 => 250345)


--- trunk/Source/WTF/ChangeLog	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WTF/ChangeLog	2019-09-25 16:01:38 UTC (rev 250345)
@@ -1,3 +1,15 @@
+2019-09-25  Wenson Hsieh  <[email protected]>
+
+        [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
+        https://bugs.webkit.org/show_bug.cgi?id=202167
+        <rdar://problem/55185021>
+
+        Reviewed by Tim Horton.
+
+        Declare DYLD_IOS_VERSION_13_2.
+
+        * wtf/spi/darwin/dyldSPI.h:
+
 2019-09-24  Keith Rollin  <[email protected]>
 
         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h (250344 => 250345)


--- trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -45,6 +45,10 @@
 #define DYLD_IOS_VERSION_13_0 0x000D0000
 #endif
 
+#ifndef DYLD_IOS_VERSION_13_2
+#define DYLD_IOS_VERSION_13_2 0x000D0200
+#endif
+
 #ifndef DYLD_MACOSX_VERSION_10_13
 #define DYLD_MACOSX_VERSION_10_13 0x000A0D00
 #endif
@@ -57,6 +61,10 @@
 #define DYLD_MACOSX_VERSION_10_15 0x000A0F00
 #endif
 
+#ifndef DYLD_MACOSX_VERSION_10_15_1
+#define DYLD_MACOSX_VERSION_10_15_1 0x000A0F01
+#endif
+
 #else
 
 #define DYLD_IOS_VERSION_3_0 0x00030000
@@ -70,6 +78,7 @@
 #define DYLD_IOS_VERSION_11_3 0x000B0300
 #define DYLD_IOS_VERSION_12_0 0x000C0000
 #define DYLD_IOS_VERSION_13_0 0x000D0000
+#define DYLD_IOS_VERSION_13_2 0x000D0200
 
 #define DYLD_MACOSX_VERSION_10_11 0x000A0B00
 #define DYLD_MACOSX_VERSION_10_12 0x000A0C00
@@ -76,6 +85,7 @@
 #define DYLD_MACOSX_VERSION_10_13 0x000A0D00
 #define DYLD_MACOSX_VERSION_10_14 0x000A0E00
 #define DYLD_MACOSX_VERSION_10_15 0x000A0F00
+#define DYLD_MACOSX_VERSION_10_15_1 0x000A0F01
 
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (250344 => 250345)


--- trunk/Source/WebCore/ChangeLog	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebCore/ChangeLog	2019-09-25 16:01:38 UTC (rev 250345)
@@ -1,3 +1,20 @@
+2019-09-25  Wenson Hsieh  <[email protected]>
+
+        [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
+        https://bugs.webkit.org/show_bug.cgi?id=202167
+        <rdar://problem/55185021>
+
+        Reviewed by Tim Horton.
+
+        Adds a new site-specific quirk. See WebKit ChangeLog for more details.
+
+        * page/Quirks.cpp:
+        (WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):
+        * page/Quirks.h:
+        * platform/RuntimeApplicationChecks.h:
+        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+        (WebCore::IOSApplication::isDataActivation):
+
 2019-09-25  Jonathan Bedard  <[email protected]>
 
         Unreviewed, rolling out r250324.

Modified: trunk/Source/WebCore/page/Quirks.cpp (250344 => 250345)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-09-25 16:01:38 UTC (rev 250345)
@@ -546,6 +546,15 @@
     return equalLettersIgnoringASCIICase(m_document->url().host(), "www.zillow.com");
 }
 
+bool Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation() const
+{
+    if (!needsQuirks())
+        return false;
+
+    auto host = m_document->url().host();
+    return equalLettersIgnoringASCIICase(host, "att.com") || host.endsWithIgnoringASCIICase(".att.com");
+}
+
 bool Quirks::shouldOpenAsAboutBlank(const String& stringToOpen) const
 {
 #if PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/page/Quirks.h (250344 => 250345)


--- trunk/Source/WebCore/page/Quirks.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebCore/page/Quirks.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -68,6 +68,7 @@
     WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const;
     WEBCORE_EXPORT bool shouldAvoidResizingWhenInputViewBoundsChange() const;
     WEBCORE_EXPORT bool shouldAvoidScrollingWhenFocusedContentIsVisible() const;
+    WEBCORE_EXPORT bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation() const;
 
     WEBCORE_EXPORT bool needsYouTubeMouseOutQuirk() const;
     

Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (250344 => 250345)


--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -97,6 +97,7 @@
 WEBCORE_EXPORT bool isAppleApplication();
 WEBCORE_EXPORT bool isEvernote();
 WEBCORE_EXPORT bool isEventbrite();
+WEBCORE_EXPORT bool isDataActivation();
 
 } // IOSApplication
 

Modified: trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (250344 => 250345)


--- trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-09-25 16:01:38 UTC (rev 250345)
@@ -324,6 +324,12 @@
     return isEventbrite;
 }
 
+bool IOSApplication::isDataActivation()
+{
+    static bool isDataActivation = applicationBundleIsEqualTo("com.apple.DataActivation"_s);
+    return isDataActivation;
+}
+
 #endif
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (250344 => 250345)


--- trunk/Source/WebKit/ChangeLog	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/ChangeLog	2019-09-25 16:01:38 UTC (rev 250345)
@@ -1,3 +1,82 @@
+2019-09-25  Wenson Hsieh  <[email protected]>
+
+        [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
+        https://bugs.webkit.org/show_bug.cgi?id=202167
+        <rdar://problem/55185021>
+
+        Reviewed by Tim Horton.
+
+        When using the data activation page on www.att.com, one of the sections on the page contains several select
+        elements; in the case where the user agent:
+
+        1. contains the string "iPad", and
+        2. does not contain the string "Safari"
+
+        ...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select
+        elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element
+        after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the
+        blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility
+        with screen readers.
+
+        In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation
+        would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div
+        element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the
+        focused select element when dismissing the popover. This means that the select element is only blurred the next
+        time the user activates another focused element, such as one of the input fields on the page, or a different
+        select element. Consequently, the logic to move focus into a div element now occurs only after a different
+        element has already been focused; this results in focus moving away from newly focused elements after 1 second
+        in the case where a select element has previously focused.
+
+        To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more
+        details.
+
+        * Shared/FocusedElementInformation.cpp:
+        (WebKit::FocusedElementInformation::encode const):
+        (WebKit::FocusedElementInformation::decode):
+        * Shared/FocusedElementInformation.h:
+
+        Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select
+        popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well
+        as dismissing the popover with animation).
+
+        * Shared/WebPreferences.yaml:
+
+        Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for
+        site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes
+        various known bugs that are otherwise addressed in Safari only, via site-specific quirks.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+
+        For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to
+        false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the
+        default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the
+        web process is not necessarily linked against the same SDK as the application.
+
+        * UIProcess/Cocoa/VersionChecks.h:
+
+        Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by
+        default.
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
+        (-[WKContentView _elementDidBlur]):
+        (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
+
+        We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a
+        select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle
+        is "com.apple.DataActivation".
+
+        * UIProcess/ios/forms/WKFormSelectPopover.mm:
+        (-[WKSelectTableViewController shouldDismissWithAnimation]):
+
+        Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior.
+
+        (-[WKSelectPopover controlEndEditing]):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+
 2019-09-25  Jonathan Bedard  <[email protected]>
 
         Unreviewed, rolling out r250324.

Modified: trunk/Source/WebKit/Shared/FocusedElementInformation.cpp (250344 => 250345)


--- trunk/Source/WebKit/Shared/FocusedElementInformation.cpp	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/Shared/FocusedElementInformation.cpp	2019-09-25 16:01:38 UTC (rev 250345)
@@ -108,6 +108,7 @@
     encoder << isSpellCheckingEnabled;
     encoder << shouldAvoidResizingWhenInputViewBoundsChange;
     encoder << shouldAvoidScrollingWhenFocusedContentIsVisible;
+    encoder << shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation;
 }
 
 bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInformation& result)
@@ -238,6 +239,9 @@
     if (!decoder.decode(result.shouldAvoidScrollingWhenFocusedContentIsVisible))
         return false;
 
+    if (!decoder.decode(result.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation))
+        return false;
+
     return true;
 }
 #endif

Modified: trunk/Source/WebKit/Shared/FocusedElementInformation.h (250344 => 250345)


--- trunk/Source/WebKit/Shared/FocusedElementInformation.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/Shared/FocusedElementInformation.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -140,6 +140,7 @@
     bool isSpellCheckingEnabled { true };
     bool shouldAvoidResizingWhenInputViewBoundsChange { false };
     bool shouldAvoidScrollingWhenFocusedContentIsVisible { false };
+    bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation { false };
 
     FocusedElementIdentifier focusedElementIdentifier { 0 };
 

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (250344 => 250345)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-09-25 16:01:38 UTC (rev 250345)
@@ -106,7 +106,7 @@
 
 NeedsSiteSpecificQuirks:
   type: bool
-  defaultValue: false
+  defaultValue: true
 
 AcceleratedCompositingEnabled:
   type: bool

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (250344 => 250345)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-09-25 16:01:38 UTC (rev 250345)
@@ -686,6 +686,9 @@
         pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::serviceWorkersEnabledKey(), WebKit::WebPreferencesStore::Value(false));
 #endif
 
+    if (!linkedOnOrAfter(WebKit::SDKVersion::FirstWhereSiteSpecificQuirksAreEnabledByDefault))
+        pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::needsSiteSpecificQuirksKey(), WebKit::WebPreferencesStore::Value(false));
+
 #if PLATFORM(IOS_FAMILY)
     CGRect bounds = self.bounds;
     _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);

Modified: trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h (250344 => 250345)


--- trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -80,6 +80,7 @@
     FirstThatHasUIContextMenuInteraction = DYLD_IOS_VERSION_13_0,
     FirstWhereWKContentViewDoesNotOverrideKeyCommands = DYLD_IOS_VERSION_13_0,
     FirstThatSupportsOverflowHiddenOnMainFrame = DYLD_IOS_VERSION_13_0,
+    FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_IOS_VERSION_13_2,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
@@ -89,6 +90,7 @@
     FirstWithoutUnconditionalUniversalSandboxExtension = DYLD_MACOSX_VERSION_10_15,
     FirstWithSnapshotAfterScreenUpdates = DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES,
     FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores = DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES,
+    FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_MACOSX_VERSION_10_15_1,
 #endif
 };
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (250344 => 250345)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-09-25 16:01:38 UTC (rev 250345)
@@ -555,6 +555,7 @@
 @property (nonatomic, readonly) BOOL _shouldUseContextMenus;
 @property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange;
 @property (nonatomic, readonly) BOOL _shouldAvoidScrollingWhenFocusedContentIsVisible;
+@property (nonatomic, readonly) BOOL _shouldUseLegacySelectPopoverDismissalBehavior;
 
 - (void)_didChangeLinkPreviewAvailability;
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (250344 => 250345)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-25 16:01:38 UTC (rev 250345)
@@ -1306,7 +1306,7 @@
     if (!_webView._retainingActiveFocusedState) {
         // We need to complete the editing operation before we blur the element.
         [self _endEditing];
-        if ((reason == EndEditingReasonAccessoryDone && !currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal) {
+        if ((reason == EndEditingReasonAccessoryDone && !currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal || self._shouldUseLegacySelectPopoverDismissalBehavior) {
             _page->blurFocusedElement();
             // Don't wait for WebPageProxy::blurFocusedElement() to round-trip back to us to hide the keyboard
             // because we know that the user explicitly requested us to do so.
@@ -5562,6 +5562,7 @@
     _focusedElementInformation.shouldSynthesizeKeyEventsForEditing = false;
     _focusedElementInformation.shouldAvoidResizingWhenInputViewBoundsChange = false;
     _focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible = false;
+    _focusedElementInformation.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation = false;
     _inputPeripheral = nil;
     _focusRequiresStrongPasswordAssistance = NO;
     _additionalContextForStrongPasswordAssistance = nil;
@@ -6536,6 +6537,20 @@
     return _focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible;
 }
 
+- (BOOL)_shouldUseLegacySelectPopoverDismissalBehavior
+{
+    if (!currentUserInterfaceIdiomIsPad())
+        return NO;
+
+    if (_focusedElementInformation.elementType != WebKit::InputType::Select)
+        return NO;
+
+    if (!_focusedElementInformation.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation)
+        return NO;
+
+    return WebCore::IOSApplication::isDataActivation();
+}
+
 // FIXME: This is used for drag previews and context menu hints; it needs a better name.
 - (UIView *)containerViewForTargetedPreviews
 {

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm (250344 => 250345)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm	2019-09-25 16:01:38 UTC (rev 250345)
@@ -98,7 +98,8 @@
     WKContentView *_contentView;
 }
 
-@property(nonatomic,assign) WKSelectPopover *popover;
+@property (nonatomic, readonly) BOOL shouldDismissWithAnimation;
+@property (nonatomic, assign) WKSelectPopover *popover;
 @end
 
 @implementation WKSelectTableViewController
@@ -364,6 +365,11 @@
     }
 }
 
+- (BOOL)shouldDismissWithAnimation
+{
+    return _contentView._shouldUseLegacySelectPopoverDismissalBehavior;
+}
+
 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
 #pragma mark UIKeyInput delegate methods
 
@@ -447,7 +453,7 @@
 
 - (void)controlEndEditing
 {
-    [self dismissPopoverAnimated:NO];
+    [self dismissPopoverAnimated:[_tableViewController shouldDismissWithAnimation]];
 }
 
 - (void)_userActionDismissedPopover:(id)sender

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (250344 => 250345)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-09-25 16:01:38 UTC (rev 250345)
@@ -3060,6 +3060,7 @@
     auto& quirks = m_focusedElement->document().quirks();
     information.shouldAvoidResizingWhenInputViewBoundsChange = quirks.shouldAvoidResizingWhenInputViewBoundsChange();
     information.shouldAvoidScrollingWhenFocusedContentIsVisible = quirks.shouldAvoidScrollingWhenFocusedContentIsVisible();
+    information.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation = quirks.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation();
 }
 
 void WebPage::autofillLoginCredentials(const String& username, const String& password)

Modified: trunk/Tools/ChangeLog (250344 => 250345)


--- trunk/Tools/ChangeLog	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Tools/ChangeLog	2019-09-25 16:01:38 UTC (rev 250345)
@@ -1,3 +1,16 @@
+2019-09-25  Wenson Hsieh  <[email protected]>
+
+        [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
+        https://bugs.webkit.org/show_bug.cgi?id=202167
+        <rdar://problem/55185021>
+
+        Reviewed by Tim Horton.
+
+        Rebaseline an API test.
+
+        * TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
+        (TestWebKitAPI::TEST):
+
 2019-09-25  Jonathan Bedard  <[email protected]>
 
         Unreviewed, rolling out r250324.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp (250344 => 250345)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp	2019-09-25 14:55:30 UTC (rev 250344)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp	2019-09-25 16:01:38 UTC (rev 250345)
@@ -97,7 +97,7 @@
     EXPECT_TRUE(WKPreferencesGetAcceleratedCompositingEnabled(preference));
     EXPECT_FALSE(WKPreferencesGetCompositingBordersVisible(preference));
     EXPECT_FALSE(WKPreferencesGetCompositingRepaintCountersVisible(preference));
-    EXPECT_FALSE(WKPreferencesGetNeedsSiteSpecificQuirks(preference));
+    EXPECT_TRUE(WKPreferencesGetNeedsSiteSpecificQuirks(preference));
     EXPECT_EQ(kWKAllowAllStorage, WKPreferencesGetStorageBlockingPolicy(preference));
     EXPECT_FALSE(WKPreferencesGetTextAutosizingEnabled(preference));
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to