AX: crash at WebCore::Range::selectNodeContents(WebCore::Node*, int&)
[WebKit-https.git] / Source / WebCore / accessibility / AXObjectCache.cpp
index 5a516ebd2b1ef67eb9ca8e85b265ba3cfc3a6431..a71482d8705e9a421f140704db64e01f1871b3aa 100644 (file)
@@ -1423,6 +1423,17 @@ VisiblePosition AXObjectCache::visiblePositionForTextMarkerData(TextMarkerData&
     return visiblePos;
 }
 
+CharacterOffset AXObjectCache::characterOffsetForTextMarkerData(TextMarkerData& textMarkerData)
+{
+    if (!isNodeInUse(textMarkerData.node))
+        return CharacterOffset();
+    
+    if (textMarkerData.ignored)
+        return CharacterOffset();
+    
+    return CharacterOffset(textMarkerData.node, textMarkerData.characterStartIndex, textMarkerData.characterOffset);
+}
+
 CharacterOffset AXObjectCache::traverseToOffsetInRange(RefPtr<Range>range, int offset, bool toNodeEnd, bool stayWithinRange)
 {
     if (!range)