summaryrefslogtreecommitdiff
path: root/Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp')
-rw-r--r--Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp
index 58147fa8c..001f9d06f 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp
@@ -159,11 +159,14 @@ bool selectionBelongsToObject(AccessibilityObject* coreObject, VisibleSelection&
// AND that the selection is not just "touching" one of the
// boundaries for the selected node. We want to check whether the
// node is actually inside the region, at least partially.
- Node* node = coreObject->node();
- Node* lastDescendant = node->lastDescendant();
- return (range->intersectsNode(node, IGNORE_EXCEPTION)
- && (range->endContainer() != node || range->endOffset())
- && (range->startContainer() != lastDescendant || range->startOffset() != lastOffsetInNode(lastDescendant)));
+ auto& node = *coreObject->node();
+ auto* lastDescendant = node.lastDescendant();
+ unsigned lastOffset = lastOffsetInNode(lastDescendant);
+ auto intersectsResult = range->intersectsNode(node);
+ return !intersectsResult.hasException()
+ && intersectsResult.releaseReturnValue()
+ && (&range->endContainer() != &node || range->endOffset())
+ && (&range->startContainer() != lastDescendant || range->startOffset() != lastOffset);
}
#endif