1AX: AccessibilityObject::insertChild does not check the validity of the insertionIndex while processing grandchildren
2https://bugs.webkit.org/show_bug.cgi?id=241650
3
4Reviewed by NOBODY (OOPS!).
5
6When AccessibilityObject::insertChild is asked to insert a child that's
7ignored, we instead add that object's children. However, both
8`accessibilityIsIgnored` and `children` can cause layout, and said
9layout could cause AccessibilityObject::m_children to be cleared. This
10makes the `insertionIndex` invalid, which causes a crash.
11
12In this patch, right before m_children.insert(), we check to make sure
13the index is still valid.
14
15I wasn't able to make a test for this bug. It is difficult to reproduce,
16and the circumstances to reproduce are complex.
17
18* Source/WebCore/accessibility/AccessibilityObject.cpp:
19(WebCore::AccessibilityObject::insertChild):