Bug 264095 - AX: Give user feedback while the isolated tree is being built.
Summary: AX: Give user feedback while the isolated tree is being built.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-02 09:26 PDT by Andres Gonzalez
Modified: 2023-11-06 11:28 PST (History)
10 users (show)

See Also:


Attachments
Patch (9.83 KB, patch)
2023-11-02 11:41 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (9.83 KB, patch)
2023-11-03 06:35 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (9.85 KB, patch)
2023-11-03 14:22 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2023-11-02 09:26:58 PDT
Especially needed for large pages where building the isolated tree can take several seconds.
Comment 1 Radar WebKit Bug Importer 2023-11-02 09:27:08 PDT
<rdar://problem/117857438>
Comment 2 Andres Gonzalez 2023-11-02 11:41:06 PDT
Created attachment 468462 [details]
Patch
Comment 3 Andres Gonzalez 2023-11-03 06:35:17 PDT
Created attachment 468468 [details]
Patch
Comment 4 Tyler Wilcock 2023-11-03 10:27:36 PDT
Comment on attachment 468468 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=468468&action=review

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:-155
> -    tree->updatingSubtree(nullptr);

Is this removing the only place we set updatingSubtree to nullptr?

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:181
> +    String percent = String::number(percentComplete) + "%"_s;
> +    String title = AXProcessingPage() + " "_s + percent;

I think using makeString will be more efficient here (less String allocations).

String title = makeString(AXProcessingPage(), " ", percentComplete, "%");

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:190
> +            { AXPropertyName::TitleAttributeValue, title },

I think we can WTFMove(title) here.

> Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:389
> +    double i = 0;

Is there a more descriptive name that could be used? appendsResolved? Something else?

> Source/WebCore/platform/LocalizedStrings.cpp:955
> +    return WEB_UI_STRING("Processing page", "Title for the webarea while accessibility isolated tree is being built.");

I think this note:

"Title for the webarea while accessibility isolated tree is being built."

is only used but folks doing localization, who might not know what "isolated tree" is (and probably don't need to). Maybe we just call it the accessibility tree?
Comment 5 Andres Gonzalez 2023-11-03 14:22:19 PDT
Created attachment 468477 [details]
Patch
Comment 6 Andres Gonzalez 2023-11-03 14:37:19 PDT
(In reply to Tyler Wilcock from comment #4)
> Comment on attachment 468468 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=468468&action=review
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:-155
> > -    tree->updatingSubtree(nullptr);
> 
> Is this removing the only place we set updatingSubtree to nullptr?

AG: At the moment, this was superfluous, it was always null for a full tree. The only time it is not null is for the empty content tree, and for that tree it remains not null until the tree is destroyed. This will have a role when we implement some sort of feedback during updates of isolated subtrees or to avoid processing notifications while a subtree is being re-built.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:181
> > +    String percent = String::number(percentComplete) + "%"_s;
> > +    String title = AXProcessingPage() + " "_s + percent;
> 
> I think using makeString will be more efficient here (less String
> allocations).
> 
> String title = makeString(AXProcessingPage(), " ", percentComplete, "%");

AG: we need both Strings, the percent and the title since they are used for different purposes. Also makeString and the operator+ resolve to invoking the same method tryMakeString in StringConcatenate.h, so I don't think there is significant advantage of one over the other performance wise, and + is a lot more readable.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:190
> > +            { AXPropertyName::TitleAttributeValue, title },
> 
> I think we can WTFMove(title) here.


Fixed.
> 
> > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:389
> > +    double i = 0;
> 
> Is there a more descriptive name that could be used? appendsResolved?
> Something else?

counter since that's what it is.
> 
> > Source/WebCore/platform/LocalizedStrings.cpp:955
> > +    return WEB_UI_STRING("Processing page", "Title for the webarea while accessibility isolated tree is being built.");
> 
> I think this note:
> 
> "Title for the webarea while accessibility isolated tree is being built."
> 
> is only used but folks doing localization, who might not know what "isolated
> tree" is (and probably don't need to). Maybe we just call it the
> accessibility tree?

Removed "isolated" and left it as "accessibility tree".
Comment 7 EWS 2023-11-06 11:28:46 PST
Committed 270280@main (16714dac0820): <https://commits.webkit.org/270280@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 468477 [details].