Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm

Issue 2589973004: [ios] Fixed web-compat bug related to resetting top content inset. (Closed)
Patch Set: Merged with origin/master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
index 09d8d61d3f123c62b8f96143cd7f5945e4e973b9..5539e74936439ff56cb26194df2f34fa005398c3 100644
--- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
+++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
@@ -196,6 +196,8 @@ NSString* const kOverscollActionsDidEnd = @"OverscollActionsDidStop";
// Setup/tearDown methods are used to register values when the delegate is set.
- (void)tearDown;
- (void)setup;
+// Resets scroll view's top content inset to |self.initialContentInset|.
+- (void)resetScrollViewTopContentInset;
// Access the headerView from the delegate.
- (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView;
// Locking/unlocking methods used to disable/enable the overscroll actions
@@ -381,8 +383,7 @@ NSString* const kOverscollActionsDidEnd = @"OverscollActionsDidStop";
// restored to initial value.
if (contentOffset.y >= 0 ||
self.overscrollState == ios_internal::OverscrollState::NO_PULL_STARTED) {
- [self setScrollViewContentInset:UIEdgeInsetsMake(self.initialContentInset,
- 0, 0, 0)];
+ [self resetScrollViewTopContentInset];
}
[self triggerActionIfNeeded];
@@ -590,6 +591,12 @@ NSString* const kOverscollActionsDidEnd = @"OverscollActionsDidStop";
[_webViewScrollViewProxy setContentInset:contentInset];
}
+- (void)resetScrollViewTopContentInset {
+ UIEdgeInsets contentInset = self.scrollView.contentInset;
+ contentInset.top = self.initialContentInset;
+ [self setScrollViewContentInset:contentInset];
+}
+
- (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView {
return [self.delegate headerView];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698