Title: [178813] branches/safari-600.1.4.15-branch/Source/WebKit2
Revision
178813
Author
[email protected]
Date
2015-01-21 00:12:09 -0800 (Wed, 21 Jan 2015)

Log Message

Merged r175334.  rdar://problem/19302743

Modified Paths

Diff

Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog (178812 => 178813)


--- branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog	2015-01-21 08:11:11 UTC (rev 178812)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog	2015-01-21 08:12:09 UTC (rev 178813)
@@ -1,5 +1,27 @@
 2015-01-21  Babak Shafiei  <[email protected]>
 
+        Merge r175334.
+
+    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.
+
+2015-01-21  Babak Shafiei  <[email protected]>
+
         Merge r175266.
 
     2014-10-28  Joseph Pecoraro  <[email protected]>

Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm (178812 => 178813)


--- branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm	2015-01-21 08:11:11 UTC (rev 178812)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm	2015-01-21 08:12:09 UTC (rev 178813)
@@ -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

Reply via email to