Workaround to prevent infinite accessibilityParent access for the same view.

This commit is contained in:
Anthony Tseng
2024-02-13 09:09:13 -08:00
parent 4494290446
commit f46dde37b5
2 changed files with 23 additions and 0 deletions
@@ -0,0 +1,11 @@
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
// Temporary fix for https://github.com/brave/brave-browser/issues/35938
#define BRAVE_ACCESSIBILITY_PARENT \
if (self == _accessibilityParent) \
return [super accessibilityParent];
#include "src/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm"
#undef BRAVE_ACCESSIBILITY_PARENT
@@ -0,0 +1,12 @@
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 81f705328efd2de0957c1ef309e20c421e0959eb..589d342594bbff3a7e3ad83626b02f94adfad3f5 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -1935,6 +1935,7 @@ void ExtractUnderlines(NSAttributedString* string,
}
- (id)accessibilityParent {
+ BRAVE_ACCESSIBILITY_PARENT
if (_accessibilityParent)
return NSAccessibilityUnignoredAncestor(_accessibilityParent);
return [super accessibilityParent];