Skip to content
Permalink
Browse files
Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:…
…kind:])

https://bugs.webkit.org/show_bug.cgi?id=178358
<rdar://problem/34676899>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _didFindMatch:]):
UIPDFSelection can return a null rect as the selection's bounds.
We can't zoom to a null rect (and doing so results in CA throwing an
exception later).


Canonical link: https://commits.webkit.org/194586@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hortont424 committed Oct 16, 2017
1 parent fd11c62 commit 2d4fbe3134210cd99604bc44cbde69b225c320da
Showing with 17 additions and 0 deletions.
  1. +14 −0 Source/WebKit/ChangeLog
  2. +3 −0 Source/WebKit/UIProcess/ios/WKPDFView.mm
@@ -1,3 +1,17 @@
2017-10-16 Tim Horton <timothy_horton@apple.com>

Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
https://bugs.webkit.org/show_bug.cgi?id=178358
<rdar://problem/34676899>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _didFindMatch:]):
UIPDFSelection can return a null rect as the selection's bounds.
We can't zoom to a null rect (and doing so results in CA throwing an
exception later).

2017-10-16 Alex Christensen <achristensen@webkit.org>

Add a _WKThumbnailView initializer with a WKWebView
@@ -601,6 +601,9 @@ - (void)_didFindMatch:(UIPDFSelection *)match
_currentFindSelection = match;

CGRect zoomRect = [pageInfo.view convertRectFromPDFPageSpace:match.bounds];
if (CGRectIsNull(zoomRect))
return;

[self zoom:pageInfo.view.get() to:zoomRect atPoint:CGPointZero kind:kUIPDFObjectKindText];

return;

0 comments on commit 2d4fbe3

Please sign in to comment.