diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp')
-rw-r--r-- | Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp | 13 |
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 |