Commit 2bd9bea1 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Stops LegacyInfobarContainer A11y notification if view is nil

UIAccessibilityPostNotification might trigger once the view has been niled.
It is now crashing on iOS13 (Documentation doesn't say it can't be nil
explicitly but a nil object is not an A11y element
https://developer.apple.com/documentation/uikit/uiaccessibilitylayoutchangednotification)


Bug: 989761
Change-Id: I04cb25c0cdbfc2655255b7b3bba78b258f2df458
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844331
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703843}
parent 67b7bf3b
......@@ -108,11 +108,15 @@ const CGFloat kAlphaChangeAnimationDuration = 0.35;
CGRectGetMaxY([self.positioner parentView].frame) - height;
containerFrame.size.height = height;
__weak __typeof(self) weakSelf = self;
auto completion = ^(BOOL finished) {
if (!self.visible)
__typeof(self) strongSelf = weakSelf;
// Return if weakSelf has been niled or is not visible since there's no view
// to send an A11y post notification to.
if (!strongSelf.visible)
return;
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
self.view);
strongSelf.view);
};
ProceduralBlock frameUpdates = ^{
......
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