| Index: third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| index caf768238d37c02b1abc06aa43b4ef737e0959de..98320c8d7e2f0166e257b8bd8a8d870d25607670 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
|
| @@ -1351,14 +1351,25 @@ LayoutRect AXObject::getBoundsInFrameCoordinates() const {
|
| // Modify or take an action on an object.
|
| //
|
|
|
| -bool AXObject::press() const {
|
| - Element* actionElem = actionElement();
|
| - if (!actionElem)
|
| +bool AXObject::press() {
|
| + Document* document = getDocument();
|
| + if (!document)
|
| return false;
|
| - UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
|
| - &actionElem->document(), UserGestureToken::NewGesture));
|
| - actionElem->accessKeyAction(true);
|
| - return true;
|
| +
|
| + UserGestureIndicator gestureIndicator(
|
| + DocumentUserGestureToken::create(document, UserGestureToken::NewGesture));
|
| + Element* actionElem = actionElement();
|
| + if (actionElem) {
|
| + actionElem->accessKeyAction(true);
|
| + return true;
|
| + }
|
| +
|
| + if (canSetFocusAttribute()) {
|
| + setFocused(true);
|
| + return true;
|
| + }
|
| +
|
| + return false;
|
| }
|
|
|
| void AXObject::scrollToMakeVisible() const {
|
|
|