Commit 7d7af06c authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS] NTP: Allow Voiceover scroll back up after fakebox leaves screen

The root cause for the bug is that the fakebox fades out as it scrolls
up in landscape. After it gets all the way offscreen, its alpha is 0.
Once that happens, Voiceover doesn't recognize it as a view, so there's
no way to go back up to get it in view. To prevent this, this CL sets
the minimum alpha of the fakebox/header to 0.01, so Voiceover will
still see it. It still shouldn't affect the actual visibility because
the fakebox is behind the toolbar by the time it fades out, so it still
won't be visible.

Bug: 985726
Change-Id: Ibbb3947561e13a6312bcdc8973c7c71c25e728cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849676Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Cr-Commit-Position: refs/heads/master@{#704532}
parent db5b6c7b
...@@ -304,8 +304,15 @@ CGFloat IdentityDiscToolbarOffset(id<UITraitEnvironment> environment) { ...@@ -304,8 +304,15 @@ CGFloat IdentityDiscToolbarOffset(id<UITraitEnvironment> environment) {
CGFloat percent = CGFloat percent =
[self searchFieldProgressForOffset:offset safeAreaInsets:safeAreaInsets]; [self searchFieldProgressForOffset:offset safeAreaInsets:safeAreaInsets];
if (!IsSplitToolbarMode(self)) { if (!IsSplitToolbarMode(self)) {
self.alpha = 1 - percent; // When Voiceover is running, if the header's alpha is set to 0, voiceover
// can't scroll back to it, and it will never come back into view. To
// prevent that, set the alpha to non-zero when the header is fully
// offscreen. It will still not be seen, but it will be accessible to
// Voiceover.
self.alpha = std::max(1 - percent, 0.01);
widthConstraint.constant = searchFieldNormalWidth; widthConstraint.constant = searchFieldNormalWidth;
self.fakeLocationBarHeightConstraint.constant = ToolbarHeight(); self.fakeLocationBarHeightConstraint.constant = ToolbarHeight();
self.fakeLocationBar.layer.cornerRadius = self.fakeLocationBar.layer.cornerRadius =
......
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