Diff
Modified: trunk/Source/WebCore/ChangeLog (258312 => 258313)
--- trunk/Source/WebCore/ChangeLog 2020-03-12 04:24:58 UTC (rev 258312)
+++ trunk/Source/WebCore/ChangeLog 2020-03-12 04:25:11 UTC (rev 258313)
@@ -1,3 +1,24 @@
+2020-03-11 Andres Gonzalez <andresg...@apple.com>
+
+ Removed unused textElements member from AccessibilityText structure.
+ https://bugs.webkit.org/show_bug.cgi?id=208967
+
+ Reviewed by Chris Fleizach.
+
+ The textElements member of AccessibilityText is not used by any client
+ and its computation is causing crashes in IsolatedTree mode. So this
+ change removes it.
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::titleElementText const):
+ (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityText::AccessibilityText):
+ * accessibility/isolatedtree/AXIsolatedObject.cpp:
+ (WebCore::AXIsolatedObject::initializeAttributeData):
+ (WebCore::AXIsolatedObject::accessibilityText const):
+ * accessibility/isolatedtree/AXIsolatedObject.h:
+
2020-03-11 Don Olmstead <don.olmst...@sony.com>
Non-unified build fixes early March 2020 edition Take 2
Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (258312 => 258313)
--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2020-03-12 04:24:58 UTC (rev 258312)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2020-03-12 04:25:11 UTC (rev 258313)
@@ -1313,7 +1313,7 @@
auto objectCache = axObjectCache();
// Only use the <label> text if there's no ARIA override.
if (objectCache && !innerText.isEmpty() && !ariaAccessibilityDescription())
- textOrder.append(AccessibilityText(innerText, isMeter() ? AccessibilityTextSource::Alternative : AccessibilityTextSource::LabelByElement, objectCache->getOrCreate(label)));
+ textOrder.append(AccessibilityText(innerText, isMeter() ? AccessibilityTextSource::Alternative : AccessibilityTextSource::LabelByElement));
return;
}
}
@@ -1320,7 +1320,7 @@
AccessibilityObject* titleUIElement = this->titleUIElement();
if (titleUIElement)
- textOrder.append(AccessibilityText(String(), AccessibilityTextSource::LabelByElement, titleUIElement));
+ textOrder.append(AccessibilityText(String(), AccessibilityTextSource::LabelByElement));
}
void AccessibilityNodeObject::alternativeText(Vector<AccessibilityText>& textOrder) const
@@ -1517,7 +1517,7 @@
for (const auto& element : elements)
axElements.append(objectCache->getOrCreate(element));
- textOrder.append(AccessibilityText(ariaLabeledBy, AccessibilityTextSource::Alternative, axElements));
+ textOrder.append(AccessibilityText(ariaLabeledBy, AccessibilityTextSource::Alternative));
}
}
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (258312 => 258313)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2020-03-12 04:24:58 UTC (rev 258312)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2020-03-12 04:25:11 UTC (rev 258313)
@@ -69,28 +69,11 @@
struct AccessibilityText {
String text;
AccessibilityTextSource textSource;
- Vector<RefPtr<AXCoreObject>> textElements;
AccessibilityText(const String& t, const AccessibilityTextSource& s)
: text(t)
, textSource(s)
{ }
-
- AccessibilityText(const String& t, const AccessibilityTextSource& s, Vector<AXCoreObject*> elements)
- : text(t)
- , textSource(s)
- {
- textElements.reserveCapacity(elements.size());
- for (auto element : elements)
- textElements.uncheckedAppend(element);
- }
-
- AccessibilityText(const String& t, const AccessibilityTextSource& s, AXCoreObject* element)
- : text(t)
- , textSource(s)
- {
- textElements.append(element);
- }
};
bool nodeHasPresentationRole(Node*);
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (258312 => 258313)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2020-03-12 04:24:58 UTC (rev 258312)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2020-03-12 04:25:11 UTC (rev 258313)
@@ -317,8 +317,6 @@
AccessibilityIsolatedTreeText isolatedText;
isolatedText.text = text.text;
isolatedText.textSource = text.textSource;
- for (auto object : text.textElements)
- isolatedText.textElements.append(object->objectID());
isolatedTexts.uncheckedAppend(isolatedText);
}
setProperty(AXPropertyName::AccessibilityText, isolatedTexts);
@@ -520,10 +518,6 @@
auto isolatedTexts = vectorAttributeValue<AccessibilityIsolatedTreeText>(AXPropertyName::AccessibilityText);
for (const auto& isolatedText : isolatedTexts) {
AccessibilityText text(isolatedText.text, isolatedText.textSource);
- for (const auto& axID : isolatedText.textElements) {
- if (auto object = tree()->nodeForID(axID))
- text.textElements.append(object);
- }
texts.append(text);
}
}
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (258312 => 258313)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2020-03-12 04:24:58 UTC (rev 258312)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2020-03-12 04:25:11 UTC (rev 258313)
@@ -337,7 +337,6 @@
struct AccessibilityIsolatedTreeText {
String text;
AccessibilityTextSource textSource;
- Vector<AXID> textElements;
};
using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, FloatRect, AXID, IntPoint, OptionSet<SpeakAs>, std::pair<unsigned, unsigned>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>>;