Changeset 247702 in webkit
- Timestamp:
- Jul 22, 2019 3:14:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247701 r247702 1 2019-07-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection 4 https://bugs.webkit.org/show_bug.cgi?id=200013 5 <rdar://problem/52526901> 6 7 Reviewed by Simon Fraser. 8 9 After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in 10 UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when 11 computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size 12 as the content size, which then causes us to always scroll to the origin when revealing the selection. 13 14 To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the 15 unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget 16 is present. 17 18 Test: WebKitLegacy.ScrollToRevealSelection 19 20 * page/FrameView.cpp: 21 (WebCore::FrameView::viewRectExpandedByContentInsets const): 22 (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted. 23 24 Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the 25 fact that this may either be the visual viewport rect or unobscured content rect. 26 27 * page/FrameView.h: 28 * rendering/RenderLayer.cpp: 29 (WebCore::RenderLayer::scrollRectToVisible): 30 1 31 2019-07-22 Brent Fulgham <bfulgham@apple.com> 2 32 -
trunk/Source/WebCore/page/FrameView.cpp
r247529 r247702 1944 1944 } 1945 1945 1946 IntRect FrameView::visualViewportRectExpandedByContentInsets() const 1947 { 1948 FloatRect unobscuredContentRect = this->visualViewportRect(); 1946 IntRect FrameView::viewRectExpandedByContentInsets() const 1947 { 1948 FloatRect viewRect; 1949 if (delegatesScrolling() && platformWidget()) 1950 viewRect = unobscuredContentRect(); 1951 else 1952 viewRect = visualViewportRect(); 1953 1949 1954 if (auto* page = frame().page()) 1950 unobscuredContentRect.expand(page->contentInsets()); 1951 return IntRect(unobscuredContentRect); 1955 viewRect.expand(page->contentInsets()); 1956 1957 return IntRect(viewRect); 1952 1958 } 1953 1959 -
trunk/Source/WebCore/page/FrameView.h
r247667 r247702 328 328 #endif 329 329 330 IntRect vi sualViewportRectExpandedByContentInsets() const;330 IntRect viewRectExpandedByContentInsets() const; 331 331 332 332 bool fixedElementsLayoutRelativeToFrame() const; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r247540 r247702 2690 2690 // FIXME: ContentInsets should be taken care of in UI process side. webkit.org/b/199682 2691 2691 // To do that, getRectToExpose needs to return the additional scrolling to do beyond content rect. 2692 LayoutRect viewRect = frameView.vi sualViewportRectExpandedByContentInsets();2692 LayoutRect viewRect = frameView.viewRectExpandedByContentInsets(); 2693 2693 2694 2694 // FIXME: webkit.org/b/199683 FrameView::visibleContentRect is wrong when content insets are present -
trunk/Tools/ChangeLog
r247695 r247702 1 2019-07-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection 4 https://bugs.webkit.org/show_bug.cgi?id=200013 5 <rdar://problem/52526901> 6 7 Reviewed by Simon Fraser. 8 9 Add a new API test to verify that inserting text in UIWebView causes the document to scroll. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollToRevealSelection.mm: Added. 13 (-[LegacyLoadingDelegate webViewDidFinishLoad:]): 14 (-[LegacyLoadingDelegate waitForDidFinishLoad]): 15 * TestWebKitAPI/ios/UIKitSPI.h: 16 1 17 2019-07-22 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r247695 r247702 929 929 F42D634422A1729F00D2FB3A /* AutocorrectionTestsIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F42D634322A1729F00D2FB3A /* AutocorrectionTestsIOS.mm */; }; 930 930 F42DA5161D8CEFE400336F40 /* large-input-field-focus-onload.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F42DA5151D8CEFDB00336F40 /* large-input-field-focus-onload.html */; }; 931 F434CA1A22E65BCA005DDB26 /* ScrollToRevealSelection.mm in Sources */ = {isa = PBXBuildFile; fileRef = F434CA1922E65BCA005DDB26 /* ScrollToRevealSelection.mm */; }; 931 932 F43E3BBF20DADA1E00A4E7ED /* WKScrollViewTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F43E3BBE20DADA1E00A4E7ED /* WKScrollViewTests.mm */; }; 932 933 F43E3BC120DADBC500A4E7ED /* fixed-nav-bar.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */; }; … … 2366 2367 F42D634322A1729F00D2FB3A /* AutocorrectionTestsIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AutocorrectionTestsIOS.mm; sourceTree = "<group>"; }; 2367 2368 F42DA5151D8CEFDB00336F40 /* large-input-field-focus-onload.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "large-input-field-focus-onload.html"; path = "Tests/WebKitCocoa/large-input-field-focus-onload.html"; sourceTree = SOURCE_ROOT; }; 2369 F434CA1922E65BCA005DDB26 /* ScrollToRevealSelection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollToRevealSelection.mm; path = ScrollToRevealSelection.mm; sourceTree = "<group>"; }; 2368 2370 F43E3BBE20DADA1E00A4E7ED /* WKScrollViewTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKScrollViewTests.mm; sourceTree = "<group>"; }; 2369 2371 F43E3BC020DADB8000A4E7ED /* fixed-nav-bar.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "fixed-nav-bar.html"; sourceTree = "<group>"; }; … … 2567 2569 BCB9E7C711234E3A00A137E0 /* TestsController.h */, 2568 2570 7C83E0361D0A5F7000FEBCF3 /* Utilities.h */, 2571 7CBD5A2222DE42A6004A9E32 /* WTFStringUtilities.cpp */, 2569 2572 44A622C114A0E2B60048515B /* WTFStringUtilities.h */, 2570 7CBD5A2222DE42A6004A9E32 /* WTFStringUtilities.cpp */,2571 2573 ); 2572 2574 name = Source; … … 3908 3910 E35FC7B122B82A6D00F32F98 /* JSLockTakesWebThreadLock.mm */, 3909 3911 CDC0932A21C872C10030C4B0 /* ScrollingDoesNotPauseMedia.mm */, 3912 F434CA1922E65BCA005DDB26 /* ScrollToRevealSelection.mm */, 3910 3913 0F4FFA9D1ED3AA8500F7111F /* SnapshotViaRenderInContext.mm */, 3911 3914 ); … … 4138 4141 7C83DE991D0A590C00FEBCF3 /* AtomString.cpp in Sources */, 4139 4142 1ADAD1501D77A9F600212586 /* BlockPtr.mm in Sources */, 4140 7CBD5A2322DE42A6004A9E32 /* WTFStringUtilities.cpp in Sources */,4141 4143 7C83DE9C1D0A590C00FEBCF3 /* BloomFilter.cpp in Sources */, 4142 4144 7C83DEA01D0A590C00FEBCF3 /* CheckedArithmeticOperations.cpp in Sources */, … … 4215 4217 57C3FA661F7C248F009D4B80 /* WeakPtr.cpp in Sources */, 4216 4218 7C83DF631D0A590C00FEBCF3 /* WTFString.cpp in Sources */, 4219 7CBD5A2322DE42A6004A9E32 /* WTFStringUtilities.cpp in Sources */, 4217 4220 ); 4218 4221 runOnlyForDeploymentPostprocessing = 0; … … 4294 4297 5C2936931D5BF70D00DEAB1E /* CookieAcceptPolicy.mm in Sources */, 4295 4298 51D1249B1E785425002B2820 /* CookieManager.cpp in Sources */, 4296 7C74C8FA22DFBA9600DA2DAB /* WTFStringUtilities.cpp in Sources */,4297 4299 5C19A5241FD0F60100EEA323 /* CookiePrivateBrowsing.mm in Sources */, 4298 4300 9B1F6F781F90558400B55744 /* CopyHTML.mm in Sources */, … … 4554 4556 CDC0932B21C872C10030C4B0 /* ScrollingDoesNotPauseMedia.mm in Sources */, 4555 4557 7CCE7F121A411AE600447C4C /* ScrollPinningBehaviors.cpp in Sources */, 4558 F434CA1A22E65BCA005DDB26 /* ScrollToRevealSelection.mm in Sources */, 4556 4559 F4C8797F2059D8D3009CD00B /* ScrollViewInsetTests.mm in Sources */, 4557 4560 0FF1134E22D68679009A81DA /* ScrollViewScrollabilityTests.mm in Sources */, … … 4713 4716 CD7F89DC22A86CDA00D683AE /* WKWebViewSuspendAllMediaPlayback.mm in Sources */, 4714 4717 9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */, 4718 7C74C8FA22DFBA9600DA2DAB /* WTFStringUtilities.cpp in Sources */, 4715 4719 9C64DC321D76198A004B598E /* YouTubePluginReplacement.cpp in Sources */, 4716 4720 ); -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r247524 r247702 43 43 #import <UIKit/UIWebFormAccessory.h> 44 44 45 IGNORE_WARNINGS_BEGIN("deprecated-implementations") 46 #import <UIKit/UIWebBrowserView.h> 47 #import <UIKit/UIWebView_Private.h> 48 IGNORE_WARNINGS_END 49 45 50 #if PLATFORM(IOS) 46 51 @protocol UIDragSession; … … 156 161 @end 157 162 163 IGNORE_WARNINGS_BEGIN("deprecated-implementations") 164 165 @interface UIWebBrowserView : UIView <UIKeyInput> 166 @end 167 168 @interface UIWebView (Private) 169 - (UIWebBrowserView *)_browserView; 170 @end 171 172 IGNORE_WARNINGS_END 173 158 174 #endif 159 175
Note: See TracChangeset
for help on using the changeset viewer.