Commit 61701cc0 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Fix BVC's |-isTabScrolledToTopForBubblePresenter:|.

Now that the scroll proxy's contentInset is not guaranteed to be zero,
we need to check against the contentInset instead of CGPointZero.

Bug: 894617
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I5ba5131c969a4584879be905a92f0736a34d7f46
Reviewed-on: https://chromium-review.googlesource.com/c/1277674Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599161}
parent 042ad90a
......@@ -3057,8 +3057,10 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
- (BOOL)isTabScrolledToTopForBubblePresenter:(BubblePresenter*)bubblePresenter {
DCHECK(bubblePresenter == self.bubblePresenter);
CGPoint scrollOffset =
self.currentWebState->GetWebViewProxy().scrollViewProxy.contentOffset;
CRWWebViewScrollViewProxy* scrollProxy =
self.currentWebState->GetWebViewProxy().scrollViewProxy;
CGPoint scrollOffset = scrollProxy.contentOffset;
UIEdgeInsets contentInset = scrollProxy.contentInset;
// If there is a native controller, use the native controller's scroll offset.
id nativeController =
......@@ -3068,7 +3070,7 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
scrollOffset = [nativeController scrollOffset];
}
return CGPointEqualToPoint(scrollOffset, CGPointZero);
return AreCGFloatsEqual(scrollOffset.y, -contentInset.top);
}
#pragma mark - SnapshotGeneratorDelegate methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment