Bug 269628 - AX: Update cached text runs when line layout changes
Summary: AX: Update cached text runs when line layout changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joshua Hoffman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-02-16 16:48 PST by Joshua Hoffman
Modified: 2024-02-19 14:33 PST (History)
15 users (show)

See Also:


Attachments
Patch (9.55 KB, patch)
2024-02-16 17:06 PST, Joshua Hoffman
no flags Details | Formatted Diff | Diff
Patch (9.58 KB, patch)
2024-02-19 10:03 PST, Joshua Hoffman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Hoffman 2024-02-16 16:48:37 PST
We don't update cached text runs when they change at present.
Comment 1 Radar WebKit Bug Importer 2024-02-16 16:48:47 PST
<rdar://problem/123122761>
Comment 2 Joshua Hoffman 2024-02-16 17:06:00 PST
Created attachment 469939 [details]
Patch
Comment 3 Tyler Wilcock 2024-02-17 13:53:24 PST
Comment on attachment 469939 [details]
Patch

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

> COMMIT_MESSAGE:17
> +* LayoutTests/accessibility/ax-thread-text-apis/changing-text-runs.html: Added.

I wonder if something like "dynamic-text-line-wrapping.html" would be a better name. I imagine we'll want to add lots more tests where we dynamically change the underlying text runs data structure and test the result, which would make the current name of this test confusing.

> Source/WebCore/accessibility/AXObjectCache.h:221
> +    void onTextRunsChanged(RenderObject&);

Can this be const RenderObject&?

> Source/WebCore/rendering/RenderBlockFlow.cpp:4042
> +        if (auto* axObjectCache = document().axObjectCache())

This should use Document::existingAXObjectCache() instead of axObjectCache(). The latter creates a cache if one doesn't already exist, which is probably not what we want here?

Maybe just `cache` instead of `axObjectCache`?

> LayoutTests/accessibility/ax-thread-text-apis/changing-text-runs.html:9
> +<p id="line" style="word-break: break-word;">Hello world.</p>

Maybe id="paragraph"?

> LayoutTests/accessibility/ax-thread-text-apis/changing-text-runs.html:12
> +<script>
> +    var output = "This tests that text runs are updated when a container is resized and text wraps.\n";

Everything inside the script tag can be indented one less level.
Comment 4 Joshua Hoffman 2024-02-19 09:20:02 PST
Comment on attachment 469939 [details]
Patch

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

>> COMMIT_MESSAGE:17
>> +* LayoutTests/accessibility/ax-thread-text-apis/changing-text-runs.html: Added.
> 
> I wonder if something like "dynamic-text-line-wrapping.html" would be a better name. I imagine we'll want to add lots more tests where we dynamically change the underlying text runs data structure and test the result, which would make the current name of this test confusing.

Good point, will update that.
Comment 5 Joshua Hoffman 2024-02-19 10:03:43 PST
Created attachment 469966 [details]
Patch
Comment 6 EWS 2024-02-19 14:33:22 PST
Committed 274999@main (ed2bfb346eb5): <https://commits.webkit.org/274999@main>

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