Changeset 250345 in webkit
- Timestamp:
- Sep 25, 2019, 9:01:38 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r250309 r250345 1 2019-09-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com 4 https://bugs.webkit.org/show_bug.cgi?id=202167 5 <rdar://problem/55185021> 6 7 Reviewed by Tim Horton. 8 9 Declare DYLD_IOS_VERSION_13_2. 10 11 * wtf/spi/darwin/dyldSPI.h: 12 1 13 2019-09-24 Keith Rollin <krollin@apple.com> 2 14 -
trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h
r247793 r250345 46 46 #endif 47 47 48 #ifndef DYLD_IOS_VERSION_13_2 49 #define DYLD_IOS_VERSION_13_2 0x000D0200 50 #endif 51 48 52 #ifndef DYLD_MACOSX_VERSION_10_13 49 53 #define DYLD_MACOSX_VERSION_10_13 0x000A0D00 … … 56 60 #ifndef DYLD_MACOSX_VERSION_10_15 57 61 #define DYLD_MACOSX_VERSION_10_15 0x000A0F00 62 #endif 63 64 #ifndef DYLD_MACOSX_VERSION_10_15_1 65 #define DYLD_MACOSX_VERSION_10_15_1 0x000A0F01 58 66 #endif 59 67 … … 71 79 #define DYLD_IOS_VERSION_12_0 0x000C0000 72 80 #define DYLD_IOS_VERSION_13_0 0x000D0000 81 #define DYLD_IOS_VERSION_13_2 0x000D0200 73 82 74 83 #define DYLD_MACOSX_VERSION_10_11 0x000A0B00 … … 77 86 #define DYLD_MACOSX_VERSION_10_14 0x000A0E00 78 87 #define DYLD_MACOSX_VERSION_10_15 0x000A0F00 88 #define DYLD_MACOSX_VERSION_10_15_1 0x000A0F01 79 89 80 90 #endif -
trunk/Source/WebCore/ChangeLog
r250344 r250345 1 2019-09-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com 4 https://bugs.webkit.org/show_bug.cgi?id=202167 5 <rdar://problem/55185021> 6 7 Reviewed by Tim Horton. 8 9 Adds a new site-specific quirk. See WebKit ChangeLog for more details. 10 11 * page/Quirks.cpp: 12 (WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const): 13 * page/Quirks.h: 14 * platform/RuntimeApplicationChecks.h: 15 * platform/cocoa/RuntimeApplicationChecksCocoa.mm: 16 (WebCore::IOSApplication::isDataActivation): 17 1 18 2019-09-25 Jonathan Bedard <jbedard@apple.com> 2 19 -
trunk/Source/WebCore/page/Quirks.cpp
r250326 r250345 547 547 } 548 548 549 bool Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation() const 550 { 551 if (!needsQuirks()) 552 return false; 553 554 auto host = m_document->url().host(); 555 return equalLettersIgnoringASCIICase(host, "att.com") || host.endsWithIgnoringASCIICase(".att.com"); 556 } 557 549 558 bool Quirks::shouldOpenAsAboutBlank(const String& stringToOpen) const 550 559 { -
trunk/Source/WebCore/page/Quirks.h
r250326 r250345 69 69 WEBCORE_EXPORT bool shouldAvoidResizingWhenInputViewBoundsChange() const; 70 70 WEBCORE_EXPORT bool shouldAvoidScrollingWhenFocusedContentIsVisible() const; 71 WEBCORE_EXPORT bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation() const; 71 72 72 73 WEBCORE_EXPORT bool needsYouTubeMouseOutQuirk() const; -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.h
r249770 r250345 98 98 WEBCORE_EXPORT bool isEvernote(); 99 99 WEBCORE_EXPORT bool isEventbrite(); 100 WEBCORE_EXPORT bool isDataActivation(); 100 101 101 102 } // IOSApplication -
trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
r249770 r250345 325 325 } 326 326 327 bool IOSApplication::isDataActivation() 328 { 329 static bool isDataActivation = applicationBundleIsEqualTo("com.apple.DataActivation"_s); 330 return isDataActivation; 331 } 332 327 333 #endif 328 334 -
trunk/Source/WebKit/ChangeLog
r250344 r250345 1 2019-09-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com 4 https://bugs.webkit.org/show_bug.cgi?id=202167 5 <rdar://problem/55185021> 6 7 Reviewed by Tim Horton. 8 9 When using the data activation page on www.att.com, one of the sections on the page contains several select 10 elements; in the case where the user agent: 11 12 1. contains the string "iPad", and 13 2. does not contain the string "Safari" 14 15 ...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select 16 elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element 17 after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the 18 blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility 19 with screen readers. 20 21 In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation 22 would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div 23 element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the 24 focused select element when dismissing the popover. This means that the select element is only blurred the next 25 time the user activates another focused element, such as one of the input fields on the page, or a different 26 select element. Consequently, the logic to move focus into a div element now occurs only after a different 27 element has already been focused; this results in focus moving away from newly focused elements after 1 second 28 in the case where a select element has previously focused. 29 30 To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more 31 details. 32 33 * Shared/FocusedElementInformation.cpp: 34 (WebKit::FocusedElementInformation::encode const): 35 (WebKit::FocusedElementInformation::decode): 36 * Shared/FocusedElementInformation.h: 37 38 Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select 39 popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well 40 as dismissing the popover with animation). 41 42 * Shared/WebPreferences.yaml: 43 44 Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for 45 site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes 46 various known bugs that are otherwise addressed in Safari only, via site-specific quirks. 47 48 * UIProcess/API/Cocoa/WKWebView.mm: 49 (-[WKWebView _initializeWithConfiguration:]): 50 51 For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to 52 false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the 53 default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the 54 web process is not necessarily linked against the same SDK as the application. 55 56 * UIProcess/Cocoa/VersionChecks.h: 57 58 Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by 59 default. 60 61 * UIProcess/ios/WKContentViewInteraction.h: 62 * UIProcess/ios/WKContentViewInteraction.mm: 63 (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): 64 (-[WKContentView _elementDidBlur]): 65 (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]): 66 67 We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a 68 select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle 69 is "com.apple.DataActivation". 70 71 * UIProcess/ios/forms/WKFormSelectPopover.mm: 72 (-[WKSelectTableViewController shouldDismissWithAnimation]): 73 74 Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior. 75 76 (-[WKSelectPopover controlEndEditing]): 77 * WebProcess/WebPage/ios/WebPageIOS.mm: 78 (WebKit::WebPage::getFocusedElementInformation): 79 1 80 2019-09-25 Jonathan Bedard <jbedard@apple.com> 2 81 -
trunk/Source/WebKit/Shared/FocusedElementInformation.cpp
r247746 r250345 109 109 encoder << shouldAvoidResizingWhenInputViewBoundsChange; 110 110 encoder << shouldAvoidScrollingWhenFocusedContentIsVisible; 111 encoder << shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation; 111 112 } 112 113 … … 239 240 return false; 240 241 242 if (!decoder.decode(result.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation)) 243 return false; 244 241 245 return true; 242 246 } -
trunk/Source/WebKit/Shared/FocusedElementInformation.h
r247746 r250345 141 141 bool shouldAvoidResizingWhenInputViewBoundsChange { false }; 142 142 bool shouldAvoidScrollingWhenFocusedContentIsVisible { false }; 143 bool shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation { false }; 143 144 144 145 FocusedElementIdentifier focusedElementIdentifier { 0 }; -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r250336 r250345 107 107 NeedsSiteSpecificQuirks: 108 108 type: bool 109 defaultValue: false109 defaultValue: true 110 110 111 111 AcceleratedCompositingEnabled: -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r250093 r250345 687 687 #endif 688 688 689 if (!linkedOnOrAfter(WebKit::SDKVersion::FirstWhereSiteSpecificQuirksAreEnabledByDefault)) 690 pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::needsSiteSpecificQuirksKey(), WebKit::WebPreferencesStore::Value(false)); 691 689 692 #if PLATFORM(IOS_FAMILY) 690 693 CGRect bounds = self.bounds; -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r249770 r250345 81 81 FirstWhereWKContentViewDoesNotOverrideKeyCommands = DYLD_IOS_VERSION_13_0, 82 82 FirstThatSupportsOverflowHiddenOnMainFrame = DYLD_IOS_VERSION_13_0, 83 FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_IOS_VERSION_13_2, 83 84 #elif PLATFORM(MAC) 84 85 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, … … 90 91 FirstWithSnapshotAfterScreenUpdates = DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES, 91 92 FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores = DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES, 93 FirstWhereSiteSpecificQuirksAreEnabledByDefault = DYLD_MACOSX_VERSION_10_15_1, 92 94 #endif 93 95 }; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r250256 r250345 556 556 @property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange; 557 557 @property (nonatomic, readonly) BOOL _shouldAvoidScrollingWhenFocusedContentIsVisible; 558 @property (nonatomic, readonly) BOOL _shouldUseLegacySelectPopoverDismissalBehavior; 558 559 559 560 - (void)_didChangeLinkPreviewAvailability; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r250315 r250345 1307 1307 // We need to complete the editing operation before we blur the element. 1308 1308 [self _endEditing]; 1309 if ((reason == EndEditingReasonAccessoryDone && !currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal ) {1309 if ((reason == EndEditingReasonAccessoryDone && !currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal || self._shouldUseLegacySelectPopoverDismissalBehavior) { 1310 1310 _page->blurFocusedElement(); 1311 1311 // Don't wait for WebPageProxy::blurFocusedElement() to round-trip back to us to hide the keyboard … … 5563 5563 _focusedElementInformation.shouldAvoidResizingWhenInputViewBoundsChange = false; 5564 5564 _focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible = false; 5565 _focusedElementInformation.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation = false; 5565 5566 _inputPeripheral = nil; 5566 5567 _focusRequiresStrongPasswordAssistance = NO; … … 6535 6536 { 6536 6537 return _focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible; 6538 } 6539 6540 - (BOOL)_shouldUseLegacySelectPopoverDismissalBehavior 6541 { 6542 if (!currentUserInterfaceIdiomIsPad()) 6543 return NO; 6544 6545 if (_focusedElementInformation.elementType != WebKit::InputType::Select) 6546 return NO; 6547 6548 if (!_focusedElementInformation.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation) 6549 return NO; 6550 6551 return WebCore::IOSApplication::isDataActivation(); 6537 6552 } 6538 6553 -
trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
r250306 r250345 99 99 } 100 100 101 @property(nonatomic,assign) WKSelectPopover *popover; 101 @property (nonatomic, readonly) BOOL shouldDismissWithAnimation; 102 @property (nonatomic, assign) WKSelectPopover *popover; 102 103 @end 103 104 … … 365 366 } 366 367 368 - (BOOL)shouldDismissWithAnimation 369 { 370 return _contentView._shouldUseLegacySelectPopoverDismissalBehavior; 371 } 372 367 373 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 368 374 #pragma mark UIKeyInput delegate methods … … 448 454 - (void)controlEndEditing 449 455 { 450 [self dismissPopoverAnimated: NO];456 [self dismissPopoverAnimated:[_tableViewController shouldDismissWithAnimation]]; 451 457 } 452 458 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r250315 r250345 3061 3061 information.shouldAvoidResizingWhenInputViewBoundsChange = quirks.shouldAvoidResizingWhenInputViewBoundsChange(); 3062 3062 information.shouldAvoidScrollingWhenFocusedContentIsVisible = quirks.shouldAvoidScrollingWhenFocusedContentIsVisible(); 3063 information.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation = quirks.shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation(); 3063 3064 } 3064 3065 -
trunk/Tools/ChangeLog
r250344 r250345 1 2019-09-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com 4 https://bugs.webkit.org/show_bug.cgi?id=202167 5 <rdar://problem/55185021> 6 7 Reviewed by Tim Horton. 8 9 Rebaseline an API test. 10 11 * TestWebKitAPI/Tests/WebKit/WKPreferences.cpp: 12 (TestWebKitAPI::TEST): 13 1 14 2019-09-25 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp
r244390 r250345 98 98 EXPECT_FALSE(WKPreferencesGetCompositingBordersVisible(preference)); 99 99 EXPECT_FALSE(WKPreferencesGetCompositingRepaintCountersVisible(preference)); 100 EXPECT_ FALSE(WKPreferencesGetNeedsSiteSpecificQuirks(preference));100 EXPECT_TRUE(WKPreferencesGetNeedsSiteSpecificQuirks(preference)); 101 101 EXPECT_EQ(kWKAllowAllStorage, WKPreferencesGetStorageBlockingPolicy(preference)); 102 102 EXPECT_FALSE(WKPreferencesGetTextAutosizingEnabled(preference));
Note:
See TracChangeset
for help on using the changeset viewer.