Title: [175334] trunk/Source/WebKit2
- Revision
- 175334
- Author
- [email protected]
- Date
- 2014-10-29 11:22:21 -0700 (Wed, 29 Oct 2014)
Log Message
[iOS] iPad: Occasional <select> crashes attempting to scroll to non-existing row 0 in viewWillAppear
https://bugs.webkit.org/show_bug.cgi?id=138165
Reviewed by David Kilzer.
This is a speculative fix for a crash attempting to scroll to a row in a
select picker on iPad. In these cases we are trying to scroll to the first
row of the first section, but no such row appears to exist. I was unable
to reproduce the issue, but if it is happening we should be able to protect
safely protect against crashing.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController viewWillAppear:]):
Protect against trying to scroll to a section/row that does not exist
by pre-checking that the section/row is valid.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (175333 => 175334)
--- trunk/Source/WebKit2/ChangeLog 2014-10-29 17:53:26 UTC (rev 175333)
+++ trunk/Source/WebKit2/ChangeLog 2014-10-29 18:22:21 UTC (rev 175334)
@@ -1,3 +1,21 @@
+2014-10-29 Joseph Pecoraro <[email protected]>
+
+ [iOS] iPad: Occasional <select> crashes attempting to scroll to non-existing row 0 in viewWillAppear
+ https://bugs.webkit.org/show_bug.cgi?id=138165
+
+ Reviewed by David Kilzer.
+
+ This is a speculative fix for a crash attempting to scroll to a row in a
+ select picker on iPad. In these cases we are trying to scroll to the first
+ row of the first section, but no such row appears to exist. I was unable
+ to reproduce the issue, but if it is happening we should be able to protect
+ safely protect against crashing.
+
+ * UIProcess/ios/forms/WKFormSelectPopover.mm:
+ (-[WKSelectTableViewController viewWillAppear:]):
+ Protect against trying to scroll to a section/row that does not exist
+ by pre-checking that the section/row is valid.
+
2014-10-28 Ting-Wei Lan <[email protected]>
Cast std::chrono::duration.count() to int64_t in ArgumentCoder
Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm (175333 => 175334)
--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm 2014-10-29 17:53:26 UTC (rev 175333)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm 2014-10-29 18:22:21 UTC (rev 175334)
@@ -143,11 +143,18 @@
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
-
- if (_singleSelectionIndex != NSNotFound) {
- NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_singleSelectionIndex inSection:_singleSelectionSection];
- [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
- }
+
+ if (_singleSelectionIndex == NSNotFound)
+ return;
+
+ if (_singleSelectionSection >= (NSUInteger)[self.tableView numberOfSections])
+ return;
+
+ if (_singleSelectionIndex >= (NSUInteger)[self.tableView numberOfRowsInSection:_singleSelectionSection])
+ return;
+
+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_singleSelectionIndex inSection:_singleSelectionSection];
+ [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}
#pragma mark UITableView delegate methods
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes