Commit 3e73968f authored by nektar@chromium.org's avatar nektar@chromium.org

Fixed AXLayoutObject::getSelection() so that it doesn't return nullptr for...

Fixed AXLayoutObject::getSelection() so that it doesn't return nullptr for anchor and focus objects.

BUG=491027
R=dtseng@chromium.org, dglazkov@chromium.org

Review URL: https://codereview.chromium.org/1300113006

git-svn-id: svn://svn.chromium.org/blink/trunk@200941 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d8dfdb9b
......@@ -1866,7 +1866,8 @@ AXObject::AXRange AXLayoutObject::selection() const
// Find the closest node that has a corresponding AXObject.
// This is because some nodes may be aria hidden or might not even have
// a layout object if they are part of the shadow DOM.
while (anchorNode && !getUnignoredObjectFromNode(*anchorNode)) {
while (anchorNode
&& !(anchorObject = getUnignoredObjectFromNode(*anchorNode))) {
if (anchorNode->nextSibling())
anchorNode = anchorNode->nextSibling();
else
......@@ -1879,7 +1880,8 @@ AXObject::AXRange AXLayoutObject::selection() const
ASSERT(focusNode);
RefPtrWillBeRawPtr<AXObject> focusObject = nullptr;
while (focusNode && !getUnignoredObjectFromNode(*focusNode)) {
while (focusNode
&& !(focusObject = getUnignoredObjectFromNode(*focusNode))) {
if (focusNode->previousSibling())
focusNode = focusNode->previousSibling();
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment