Bug 262002 - AX: Non-group and non-tree-item children of role="treeitem"s become stale after dynamic changes
Summary: AX: Non-group and non-tree-item children of role="treeitem"s become stale aft...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-23 10:59 PDT by Tyler Wilcock
Modified: 2023-09-24 21:22 PDT (History)
10 users (show)

See Also:


Attachments
Patch (12.74 KB, patch)
2023-09-23 11:04 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (12.62 KB, patch)
2023-09-23 15:58 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2023-09-23 10:59:15 PDT
...
Comment 1 Radar WebKit Bug Importer 2023-09-23 10:59:24 PDT
<rdar://problem/115936550>
Comment 2 Tyler Wilcock 2023-09-23 11:04:45 PDT
Created attachment 467835 [details]
Patch
Comment 3 chris fleizach 2023-09-23 12:04:53 PDT
Comment on attachment 467835 [details]
Patch

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

> LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
> +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))

This looks wrong
Comment 4 Tyler Wilcock 2023-09-23 12:14:36 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 467835 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467835&action=review
> 
> > LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
> > +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))
> 
> This looks wrong
How so? It moves #foo-button to be a child of #treeitem2.
Comment 5 chris fleizach 2023-09-23 13:26:04 PDT
Comment on attachment 467835 [details]
Patch

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

>>> LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
>>> +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))
>> 
>> This looks wrong
> 
> How so? It moves #foo-button to be a child of #treeitem2.

Shouldn't this JavaScript have been executed? This is the expected file
Comment 6 Tyler Wilcock 2023-09-23 14:50:33 PDT
(In reply to chris fleizach from comment #5)
> Comment on attachment 467835 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467835&action=review
> 
> >>> LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
> >>> +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))
> >> 
> >> This looks wrong
> > 
> > How so? It moves #foo-button to be a child of #treeitem2.
> 
> Shouldn't this JavaScript have been executed? This is the expected file
The test uses `evalAndReturn`, which executes the JavaScript and then returns it at as string so that we can include it in the output. I like it because it makes reading the expectation easier (you can see the JS alongside the expected effect to the accessibility tree). But I can remove it if you'd prefer.
Comment 7 chris fleizach 2023-09-23 15:37:32 PDT
Comment on attachment 467835 [details]
Patch

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

>>>>> LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
>>>>> +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))
>>>> 
>>>> This looks wrong
>>> 
>>> How so? It moves #foo-button to be a child of #treeitem2.
>> 
>> Shouldn't this JavaScript have been executed? This is the expected file
> 
> The test uses `evalAndReturn`, which executes the JavaScript and then returns it at as string so that we can include it in the output. I like it because it makes reading the expectation easier (you can see the JS alongside the expected effect to the accessibility tree). But I can remove it if you'd prefer.

Is this a pattern other WebKit tests are going in? Personally I think it makes expected output harder to read. I think main concern though is that we don't so this anywhere else, so why is this test case so special?
Comment 8 Tyler Wilcock 2023-09-23 15:55:41 PDT
(In reply to chris fleizach from comment #7)
> Comment on attachment 467835 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467835&action=review
> 
> >>>>> LayoutTests/accessibility/mac/tree-properties-update-after-dynamic-change-expected.txt:22
> >>>>> +document.getElementById('treeitem2').appendChild(document.getElementById('foo-button'))
> >>>> 
> >>>> This looks wrong
> >>> 
> >>> How so? It moves #foo-button to be a child of #treeitem2.
> >> 
> >> Shouldn't this JavaScript have been executed? This is the expected file
> > 
> > The test uses `evalAndReturn`, which executes the JavaScript and then returns it at as string so that we can include it in the output. I like it because it makes reading the expectation easier (you can see the JS alongside the expected effect to the accessibility tree). But I can remove it if you'd prefer.
> 
> Is this a pattern other WebKit tests are going in? Personally I think it
> makes expected output harder to read. I think main concern though is that we
> don't so this anywhere else, so why is this test case so special?
We use it in other accessibility tests, I invented it :). Andres has also expressed he doesn't like it, so I'll remove it from this patch and stop using it in future patches since that seems to be the consensus.
Comment 9 Tyler Wilcock 2023-09-23 15:58:08 PDT
Created attachment 467837 [details]
Patch
Comment 10 EWS 2023-09-24 21:21:58 PDT
Committed 268385@main (3afbb0ed02b1): <https://commits.webkit.org/268385@main>

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