Diff
Modified: branches/safari-608-branch/Source/WTF/ChangeLog (250494 => 250495)
--- branches/safari-608-branch/Source/WTF/ChangeLog 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WTF/ChangeLog 2019-09-30 01:56:41 UTC (rev 250495)
@@ -1,3 +1,125 @@
+2019-09-29 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r250345. rdar://problem/55825352
+
+ [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):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-09-25 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [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-08-19 Alan Coon <alanc...@apple.com>
Cherry-pick r248852. rdar://problem/54454547
Modified: branches/safari-608-branch/Source/WTF/wtf/spi/darwin/dyldSPI.h (250494 => 250495)
--- branches/safari-608-branch/Source/WTF/wtf/spi/darwin/dyldSPI.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WTF/wtf/spi/darwin/dyldSPI.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -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: branches/safari-608-branch/Source/WebCore/ChangeLog (250494 => 250495)
--- branches/safari-608-branch/Source/WebCore/ChangeLog 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog 2019-09-30 01:56:41 UTC (rev 250495)
@@ -1,5 +1,132 @@
2019-09-29 Alan Coon <alanc...@apple.com>
+ Cherry-pick r250345. rdar://problem/55825352
+
+ [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):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-09-25 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [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-29 Alan Coon <alanc...@apple.com>
+
Cherry-pick r249893. rdar://problem/55825342
Expose misspelling ranges for editable content to accessibility clients.
Modified: branches/safari-608-branch/Source/WebCore/page/Quirks.cpp (250494 => 250495)
--- branches/safari-608-branch/Source/WebCore/page/Quirks.cpp 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebCore/page/Quirks.cpp 2019-09-30 01:56:41 UTC (rev 250495)
@@ -566,6 +566,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: branches/safari-608-branch/Source/WebCore/page/Quirks.h (250494 => 250495)
--- branches/safari-608-branch/Source/WebCore/page/Quirks.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebCore/page/Quirks.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -69,6 +69,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: branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h (250494 => 250495)
--- branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebCore/platform/RuntimeApplicationChecks.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -96,6 +96,7 @@
WEBCORE_EXPORT bool isAppleApplication();
WEBCORE_EXPORT bool isEvernote();
WEBCORE_EXPORT bool isEventbrite();
+WEBCORE_EXPORT bool isDataActivation();
} // IOSApplication
Modified: branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (250494 => 250495)
--- branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm 2019-09-30 01:56:41 UTC (rev 250495)
@@ -318,6 +318,12 @@
return isEventbrite;
}
+bool IOSApplication::isDataActivation()
+{
+ static bool isDataActivation = applicationBundleIsEqualTo("com.apple.DataActivation"_s);
+ return isDataActivation;
+}
+
#endif
} // namespace WebCore
Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/ChangeLog 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog 2019-09-30 01:56:41 UTC (rev 250495)
@@ -1,3 +1,192 @@
+2019-09-29 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r250345. rdar://problem/55825352
+
+ [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):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-09-25 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [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-29 Babak Shafiei <bshaf...@apple.com>
Apply patch. rdar://problem/55801087
Modified: branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.cpp (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.cpp 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.cpp 2019-09-30 01:56:41 UTC (rev 250495)
@@ -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: branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.h (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/Shared/FocusedElementInformation.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -140,6 +140,7 @@
bool isSpellCheckingEnabled { true };
bool shouldAvoidResizingWhenInputViewBoundsChange { false };
bool shouldAvoidScrollingWhenFocusedContentIsVisible { false };
+ bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation { false };
FocusedElementIdentifier focusedElementIdentifier { 0 };
Modified: branches/safari-608-branch/Source/WebKit/Shared/WebPreferences.yaml (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/Shared/WebPreferences.yaml 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/Shared/WebPreferences.yaml 2019-09-30 01:56:41 UTC (rev 250495)
@@ -111,7 +111,7 @@
NeedsSiteSpecificQuirks:
type: bool
- defaultValue: false
+ defaultValue: true
AcceleratedCompositingEnabled:
type: bool
Modified: branches/safari-608-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-09-30 01:56:41 UTC (rev 250495)
@@ -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: branches/safari-608-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -83,6 +83,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,
@@ -92,6 +93,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: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-09-30 01:56:41 UTC (rev 250495)
@@ -548,6 +548,7 @@
@property (nonatomic, readonly) BOOL _shouldUseContextMenus;
@property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange;
@property (nonatomic, readonly) BOOL _shouldAvoidScrollingWhenFocusedContentIsVisible;
+@property (nonatomic, readonly) BOOL _shouldUseLegacySelectPopoverDismissalBehavior;
- (void)_didChangeLinkPreviewAvailability;
Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-09-30 01:56:41 UTC (rev 250495)
@@ -1305,7 +1305,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.
@@ -5593,6 +5593,7 @@
_focusedElementInformation.shouldSynthesizeKeyEventsForEditing = false;
_focusedElementInformation.shouldAvoidResizingWhenInputViewBoundsChange = false;
_focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible = false;
+ _focusedElementInformation.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation = false;
_inputPeripheral = nil;
_focusRequiresStrongPasswordAssistance = NO;
@@ -6566,6 +6567,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: branches/safari-608-branch/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm 2019-09-30 01:56:41 UTC (rev 250495)
@@ -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: branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (250494 => 250495)
--- branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2019-09-30 01:56:41 UTC (rev 250495)
@@ -3110,6 +3110,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: branches/safari-608-branch/Tools/ChangeLog (250494 => 250495)
--- branches/safari-608-branch/Tools/ChangeLog 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Tools/ChangeLog 2019-09-30 01:56:41 UTC (rev 250495)
@@ -1,5 +1,128 @@
2019-09-29 Alan Coon <alanc...@apple.com>
+ Cherry-pick r250345. rdar://problem/55825352
+
+ [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):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-09-25 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [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-29 Alan Coon <alanc...@apple.com>
+
Cherry-pick r249893. rdar://problem/55825342
Expose misspelling ranges for editable content to accessibility clients.
Modified: branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp (250494 => 250495)
--- branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp 2019-09-30 01:56:32 UTC (rev 250494)
+++ branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp 2019-09-30 01:56:41 UTC (rev 250495)
@@ -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));