|
|
Created:
4 years ago by Eugene But (OOO till 7-30) Modified:
3 years, 12 months ago Reviewers:
jif CC:
chromium-reviews, pkl (ping after 24h if needed), sdefresne+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[ios] Fixed web-compat bug related to resetting top content inset.
OverscrollActionsController resets top content inset every time when
scolling is finished. Before this change it assumed that bottom inset
should be always reset to 0. This is not correct for cases when soft
keyboard is displayed and bottom offset is non-zero to accomodate the
keyboard.
This CL adds resetScrollViewTopContentInset method and calls it when
scrolling is finished. Remaining fixed will be landed in separate CLs
to make changes less risky.
BUG=669908, 675763
Committed: https://crrev.com/0774dcc15d6c7f59bcca77b5c2d1288b49911707
Cr-Commit-Position: refs/heads/master@{#440273}
Patch Set 1 #Patch Set 2 : Merged with origin/master #Patch Set 3 : Merged with origin/master #Messages
Total messages: 26 (15 generated)
eugenebut@chromium.org changed reviewers: + jif@chromium.org
I'm not landing this until upstreaming is finished, but still wanted to get a review.
The CQ bit was checked by eugenebut@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
jif?
lgtm
Thanks!
The CQ bit was checked by eugenebut@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm: While running git apply --index -p1; error: patch failed: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm:590 error: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm: patch does not apply Patch: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm 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 a3f360ffaf8611c7886aa0dbae8b8679c1dcf8e0..628576e4462d4f3cfa56a4a7d74bacff25e633a3 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 setContentInsetFast:contentInset]; } +- (void)resetScrollViewTopContentInset { + UIEdgeInsets contentInset = self.scrollView.contentInset; + contentInset.top = self.initialContentInset; + [self setScrollViewContentInset:contentInset]; +} + - (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView { return [self.delegate headerView]; }
The CQ bit was checked by eugenebut@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jif@chromium.org Link to the patchset: https://codereview.chromium.org/2589973004/#ps20001 (title: "Merged with origin/master")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm: While running git apply --index -p1; error: patch failed: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm:590 error: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm: patch does not apply Patch: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm 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 a3f360ffaf8611c7886aa0dbae8b8679c1dcf8e0..628576e4462d4f3cfa56a4a7d74bacff25e633a3 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 setContentInsetFast:contentInset]; } +- (void)resetScrollViewTopContentInset { + UIEdgeInsets contentInset = self.scrollView.contentInset; + contentInset.top = self.initialContentInset; + [self setScrollViewContentInset:contentInset]; +} + - (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView { return [self.delegate headerView]; }
The CQ bit was checked by eugenebut@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jif@chromium.org Link to the patchset: https://codereview.chromium.org/2589973004/#ps40001 (title: "Merged with origin/master")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1482364492527370, "parent_rev": "5d57d765d0ced19888f1d81a4faddfe02cfd8e7e", "commit_rev": "b299c6f341901067fa2a496b25c2f5bbcf6c8a2a"}
Message was sent while issue was closed.
Description was changed from ========== [ios] Fixed web-compat bug related to resetting top content inset. OverscrollActionsController resets top content inset every time when scolling is finished. Before this change it assumed that bottom inset should be always reset to 0. This is not correct for cases when soft keyboard is displayed and bottom offset is non-zero to accomodate the keyboard. This CL adds resetScrollViewTopContentInset method and calls it when scrolling is finished. Remaining fixed will be landed in separate CLs to make changes less risky. BUG=669908,675763 ========== to ========== [ios] Fixed web-compat bug related to resetting top content inset. OverscrollActionsController resets top content inset every time when scolling is finished. Before this change it assumed that bottom inset should be always reset to 0. This is not correct for cases when soft keyboard is displayed and bottom offset is non-zero to accomodate the keyboard. This CL adds resetScrollViewTopContentInset method and calls it when scrolling is finished. Remaining fixed will be landed in separate CLs to make changes less risky. BUG=669908,675763 Review-Url: https://codereview.chromium.org/2589973004 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== [ios] Fixed web-compat bug related to resetting top content inset. OverscrollActionsController resets top content inset every time when scolling is finished. Before this change it assumed that bottom inset should be always reset to 0. This is not correct for cases when soft keyboard is displayed and bottom offset is non-zero to accomodate the keyboard. This CL adds resetScrollViewTopContentInset method and calls it when scrolling is finished. Remaining fixed will be landed in separate CLs to make changes less risky. BUG=669908,675763 Review-Url: https://codereview.chromium.org/2589973004 ========== to ========== [ios] Fixed web-compat bug related to resetting top content inset. OverscrollActionsController resets top content inset every time when scolling is finished. Before this change it assumed that bottom inset should be always reset to 0. This is not correct for cases when soft keyboard is displayed and bottom offset is non-zero to accomodate the keyboard. This CL adds resetScrollViewTopContentInset method and calls it when scrolling is finished. Remaining fixed will be landed in separate CLs to make changes less risky. BUG=669908,675763 Committed: https://crrev.com/0774dcc15d6c7f59bcca77b5c2d1288b49911707 Cr-Commit-Position: refs/heads/master@{#440273} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/0774dcc15d6c7f59bcca77b5c2d1288b49911707 Cr-Commit-Position: refs/heads/master@{#440273} |