Commit 8bc3a0e
committed
REGRESSION (298476@main): [AX] Crash under WebCore::Editor::respondToChangedContents when VoiceOver is enabled
https://bugs.webkit.org/show_bug.cgi?id=301982
rdar://163230929
Reviewed by Abrar Rahman Protyasha.
Restore a null check for `node` in `Editor::respondToChangedContents` that was (effectively) removed
in 298476@main. Prior to that patch, we only passed a pointer into `AXObjectCache::postNotification`,
which would become a no-op if the `node` was null. After that change, we now (incorrectly) assume
the `node` is non-null and dereference it.
The selection start node might be null in the case where, while processing the editing command, we
mutated the DOM in such a way that the selection anchor is no longer connected or editable.
Test: accessibility/crash-when-deleting-hidden-element.html
* LayoutTests/accessibility/crash-when-deleting-hidden-element-expected.txt: Added.
* LayoutTests/accessibility/crash-when-deleting-hidden-element.html: Added.
Add a layout test to exercise the fix by verifying that we don't crash when accessibility is
enabled, under this codepath.
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::respondToChangedContents):
Canonical link: https://commits.webkit.org/302581@main1 parent b64ace9 commit 8bc3a0e
3 files changed
+46
-3
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 38 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
842 | | - | |
843 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
844 | 845 | | |
845 | 846 | | |
846 | 847 | | |
| |||
0 commit comments