Changeset 194060 in webkit
- Timestamp:
- Dec 14, 2015, 2:12:02 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/UIProcess/ios/WKPDFView.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKPDFViewResizeCrash.mm (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r194046 r194060 1 2015-12-14 Tim Horton <timothy_horton@apple.com> 2 3 Frequent crash under -[WKPDFView web_setMinimumSize:]_block_invoke 4 https://bugs.webkit.org/show_bug.cgi?id=152266 5 <rdar://problem/22092676> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/ios/WKPDFView.mm: 10 (-[WKPDFView web_setMinimumSize:]): 11 We weren't retaining the UIScrollView, but depending on it surviving 12 into this block's invocation. 13 14 We don't need to do this asynchronously anymore because the referenced 15 bug is fixed, so make it happen synchronously. This also fixes the crash 16 because there's no opportunity for the scroll view to be released. 17 1 18 2015-12-14 Tim Horton <timothy_horton@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm
r193481 r194060 220 220 [self _computePageAndDocumentFrames]; 221 221 222 // FIXME: This dispatch_async is unnecessary except to work around rdar://problem/15035620. 223 // Once that is resolved, we should do the setContentOffset without the dispatch_async. 224 RetainPtr<WKPDFView> retainedSelf = self; 225 dispatch_async(dispatch_get_main_queue(), [retainedSelf, oldDocumentLeftFraction, oldDocumentTopFraction] { 226 CGSize contentSize = retainedSelf->_scrollView.contentSize; 227 UIEdgeInsets contentInset = retainedSelf->_scrollView.contentInset; 228 [retainedSelf->_scrollView setContentOffset:CGPointMake((oldDocumentLeftFraction * contentSize.width) - contentInset.left, (oldDocumentTopFraction * contentSize.height) - contentInset.top) animated:NO]; 229 230 [retainedSelf _revalidateViews]; 231 }); 222 CGSize newContentSize = _scrollView.contentSize; 223 UIEdgeInsets contentInset = _scrollView.contentInset; 224 [_scrollView setContentOffset:CGPointMake((oldDocumentLeftFraction * newContentSize.width) - contentInset.left, (oldDocumentTopFraction * newContentSize.height) - contentInset.top) animated:NO]; 225 226 [self _revalidateViews]; 232 227 } 233 228 -
trunk/Tools/ChangeLog
r194054 r194060 1 2015-12-14 Tim Horton <timothy_horton@apple.com> 2 3 Frequent crash under -[WKPDFView web_setMinimumSize:]_block_invoke 4 https://bugs.webkit.org/show_bug.cgi?id=152266 5 <rdar://problem/22092676> 6 7 Reviewed by Simon Fraser. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKit2Cocoa/WKPDFViewResizeCrash.mm: Added. 11 Add a test that crashed before this change, and doesn't crash after. 12 1 13 2015-12-14 Chris Fleizach <cfleizach@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r192113 r194060 36 36 290F4275172A221C00939FF0 /* custom-protocol-sync-xhr.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */; }; 37 37 297234B7173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 297234B5173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp */; }; 38 2D00065F1C1F589A0088E6A7 /* WKPDFViewResizeCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D00065D1C1F58940088E6A7 /* WKPDFViewResizeCrash.mm */; }; 38 39 2D1FE0B01AD465C1006CD9E6 /* FixedLayoutSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */; }; 39 40 2D8104CC1BEC13E70020DA46 /* FindInPage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D8104CB1BEC13E70020DA46 /* FindInPage.mm */; }; … … 519 520 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestBrowsingContextLoadDelegate.mm; sourceTree = "<group>"; }; 520 521 29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestBrowsingContextLoadDelegate.h; sourceTree = "<group>"; }; 522 2D00065D1C1F58940088E6A7 /* WKPDFViewResizeCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPDFViewResizeCrash.mm; sourceTree = "<group>"; }; 521 523 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FixedLayoutSize.mm; sourceTree = "<group>"; }; 522 524 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollPinningBehaviors.cpp; sourceTree = "<group>"; }; … … 947 949 2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */, 948 950 7CC3E1FA197E234100BE6252 /* UserContentController.mm */, 951 2D00065D1C1F58940088E6A7 /* WKPDFViewResizeCrash.mm */, 949 952 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */, 950 953 ); … … 1728 1731 7CCE7F101A411AE600447C4C /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */, 1729 1732 7CCE7F111A411AE600447C4C /* RestoreSessionStateContainingFormData.cpp in Sources */, 1733 2D00065F1C1F589A0088E6A7 /* WKPDFViewResizeCrash.mm in Sources */, 1730 1734 7CCE7F4E1A411BA400447C4C /* RetainPtr.cpp in Sources */, 1731 1735 7CCE7F4D1A411B9F00447C4C /* RetainPtr.mm in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.