mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
fix: Reland "[accessibility] Platform node lifetime cleanups" (#47610)
Reland "[accessibility] Platform node lifetime cleanups" https://chromium-review.googlesource.com/c/chromium/src/+/6462552 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -307,7 +307,8 @@ std::string RecursiveDumpAXPlatformNodeAsString(
|
||||
return "";
|
||||
}
|
||||
std::string str(2 * indent, '+');
|
||||
std::string line = node->GetDelegate()->GetData().ToString();
|
||||
ui::AXPlatformNodeDelegate* const node_delegate = node->GetDelegate();
|
||||
std::string line = node_delegate->GetData().ToString();
|
||||
std::vector<std::string> attributes = base::SplitString(
|
||||
line, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||
for (const std::string& attribute : attributes) {
|
||||
@@ -317,8 +318,9 @@ std::string RecursiveDumpAXPlatformNodeAsString(
|
||||
}
|
||||
}
|
||||
str += "\n";
|
||||
for (size_t i = 0; i < node->GetDelegate()->GetChildCount(); i++) {
|
||||
gfx::NativeViewAccessible child = node->GetDelegate()->ChildAtIndex(i);
|
||||
for (size_t i = 0, child_count = node_delegate->GetChildCount();
|
||||
i < child_count; i++) {
|
||||
gfx::NativeViewAccessible child = node_delegate->ChildAtIndex(i);
|
||||
ui::AXPlatformNode* child_node =
|
||||
ui::AXPlatformNode::FromNativeViewAccessible(child);
|
||||
str += RecursiveDumpAXPlatformNodeAsString(child_node, indent + 1,
|
||||
|
||||
Reference in New Issue
Block a user