Commit c635f35
AX: AXObjectCache::remove(Node&) can be called while performing a cache update causing m_deferred* vectors to be modified as we iterate over them
https://bugs.webkit.org/show_bug.cgi?id=244421
rdar://98729717
Reviewed by Chris Fleizach.
Handling certain attribute changes in AXObjectCache::handleAttributeChange
can cause AXObjectCache::remove(Node&) to be called as a side effect.
For example, this can happen as a result of a `role` attribute change.
When this happens, the Node is removed from m_deferredAttributeChanges while
we are iterating over this vector.
This patch prevents this by making AXObjectCache::remove(Node&) bail
early before modifying any m_deferred* vector if we detect that we're in
the middle of a cache update. If this is true, these vectors will be
cleared anyways upon completion of their processing.
* LayoutTests/accessibility/multiple-attribute-change-crash-expected.txt: Added.
* LayoutTests/accessibility/multiple-attribute-change-crash.html: Added.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* LayoutTests/platform/glib/accessibility/multiple-attribute-change-crash-expected.txt: Added
* LayoutTests/platform/ios/accessibility/multiple-attribute-change-crash-expected.txt: Added.
* LayoutTests/platform/win/TestExpectations: Disable new test.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleAttributeChange):
Fix unchecked null dereference of the input Element* in an AXLOG.
Canonical link: https://commits.webkit.org/253871@main1 parent c9e2f0d commit c635f35
7 files changed
Lines changed: 105 additions & 6 deletions
File tree
- LayoutTests
- accessibility
- platform
- glib/accessibility
- ios
- accessibility
- win
- Source/WebCore/accessibility
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2141 | 2141 | | |
2142 | 2142 | | |
2143 | 2143 | | |
| 2144 | + | |
2144 | 2145 | | |
2145 | 2146 | | |
2146 | 2147 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
487 | 490 | | |
488 | 491 | | |
489 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
927 | 939 | | |
928 | 940 | | |
929 | 941 | | |
| |||
947 | 959 | | |
948 | 960 | | |
949 | 961 | | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | 962 | | |
956 | 963 | | |
957 | 964 | | |
| |||
1954 | 1961 | | |
1955 | 1962 | | |
1956 | 1963 | | |
1957 | | - | |
| 1964 | + | |
1958 | 1965 | | |
1959 | 1966 | | |
1960 | 1967 | | |
| |||
0 commit comments