Changeset 245993 in webkit
- Timestamp:
- May 31, 2019, 4:13:39 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad-expected.txt (added)
-
LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html (added)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245991 r245993 1 2019-05-31 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Reveal the focused element when it's immediately above software keyboard 4 https://bugs.webkit.org/show_bug.cgi?id=198412 5 6 Reviewed by Wenson Hsieh. 7 8 Added a regression test. Note that this test always passes on non-iPad platforms either 9 before or after this patch as _zoomToRevealFocusedElement forces scrolling in that case. 10 11 * fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad-expected.txt: Added. 12 * fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html: Added. 13 1 14 2019-05-31 Nikita Vasilyev <nvasilyev@apple.com> 2 15 -
trunk/Source/WebKit/ChangeLog
r245992 r245993 1 2019-05-31 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Reveal the focused element when it's immediately above software keyboard 4 https://bugs.webkit.org/show_bug.cgi?id=198412 5 6 Reviewed by Wenson Hsieh. 7 8 When _zoomToRevealFocusedElement is called with forceScroll set to NO (happens when input type is none or drawing 9 or when the platform is iPad), we don't force scrolling to reveal the focused element when it's entirely visible. 10 11 This can be misleading in cases where there is more content right beneath it relevant for editing operations. 12 Zoom & scroll to reveal the focused element when the said element is within 50px of the software keyboard. 13 14 * Platform/spi/ios/UIKitSPI.h: 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): 17 1 18 2019-05-31 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r245989 r245993 2328 2328 2329 2329 CGFloat visibleOffsetFromTop = 0; 2330 CGFloat minimumDistanceFromKeyboardToTriggerScroll = 0; 2330 2331 if (!CGRectIsEmpty(intersectionBetweenScrollViewAndFormAssistant)) { 2331 2332 CGFloat heightVisibleAboveFormAssistant = CGRectGetMinY(intersectionBetweenScrollViewAndFormAssistant) - CGRectGetMinY(visibleScrollViewBoundsInWebViewCoordinates); 2332 2333 CGFloat heightVisibleBelowFormAssistant = CGRectGetMaxY(visibleScrollViewBoundsInWebViewCoordinates) - CGRectGetMaxY(intersectionBetweenScrollViewAndFormAssistant); 2333 2334 2334 if (heightVisibleAboveFormAssistant >= minimumHeightToShowContentAboveKeyboard || heightVisibleBelowFormAssistant < heightVisibleAboveFormAssistant) 2335 if (heightVisibleAboveFormAssistant >= minimumHeightToShowContentAboveKeyboard || heightVisibleBelowFormAssistant < heightVisibleAboveFormAssistant) { 2335 2336 visibleSize.height = heightVisibleAboveFormAssistant; 2336 else { 2337 minimumDistanceFromKeyboardToTriggerScroll = 50; 2338 } else { 2337 2339 visibleSize.height = heightVisibleBelowFormAssistant; 2338 2340 visibleOffsetFromTop = CGRectGetMaxY(intersectionBetweenScrollViewAndFormAssistant) - CGRectGetMinY(visibleScrollViewBoundsInWebViewCoordinates); … … 2373 2375 currentlyVisibleRegionInWebViewCoordinates.origin.y += visibleOffsetFromTop; 2374 2376 currentlyVisibleRegionInWebViewCoordinates.size = visibleSize; 2377 currentlyVisibleRegionInWebViewCoordinates.size.height -= minimumDistanceFromKeyboardToTriggerScroll; 2375 2378 2376 2379 // Don't bother scrolling if the entire node is already visible, whether or not we got a selectionRect.
Note:
See TracChangeset
for help on using the changeset viewer.