| Index: third_party/WebKit/Source/core/page/FocusController.cpp
|
| diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
|
| index 2679a2bc2a2388d31e9524dc4449b976456ea25c..dfc0bd03ec509b8adc7cc29e477c532b54241b0e 100644
|
| --- a/third_party/WebKit/Source/core/page/FocusController.cpp
|
| +++ b/third_party/WebKit/Source/core/page/FocusController.cpp
|
| @@ -720,7 +720,7 @@ bool FocusController::advanceFocusInDocumentOrder(WebFocusType type, bool initia
|
| if (!element) {
|
| // We didn't find an element to focus, so we should try to pass focus to Chrome.
|
| if (!initialFocus && m_page->chromeClient().canTakeFocus(type)) {
|
| - document->setFocusedElement(nullptr);
|
| + document->clearFocusedElement();
|
| setFocusedFrame(nullptr);
|
| m_page->chromeClient().takeFocus(type);
|
| return true;
|
| @@ -750,7 +750,7 @@ bool FocusController::advanceFocusInDocumentOrder(WebFocusType type, bool initia
|
| if (!owner->contentFrame())
|
| return false;
|
|
|
| - document->setFocusedElement(nullptr);
|
| + document->clearFocusedElement();
|
| setFocusedFrame(owner->contentFrame());
|
| return true;
|
| }
|
| @@ -762,7 +762,7 @@ bool FocusController::advanceFocusInDocumentOrder(WebFocusType type, bool initia
|
|
|
| if (&newDocument != document) {
|
| // Focus is going away from this document, so clear the focused node.
|
| - document->setFocusedElement(nullptr);
|
| + document->clearFocusedElement();
|
| }
|
|
|
| setFocusedFrame(newDocument.frame());
|
| @@ -820,7 +820,12 @@ static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, LocalFrame* newF
|
| selection.clear();
|
| }
|
|
|
| -bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr<Frame> newFocusedFrame, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
|
| +bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr<Frame> newFocusedFrame)
|
| +{
|
| + return setFocusedElement(element, newFocusedFrame, FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr));
|
| +}
|
| +
|
| +bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr<Frame> newFocusedFrame, const FocusParams& params)
|
| {
|
| RefPtrWillBeRawPtr<LocalFrame> oldFocusedFrame = focusedFrame();
|
| RefPtrWillBeRawPtr<Document> oldDocument = oldFocusedFrame ? oldFocusedFrame->document() : nullptr;
|
| @@ -848,7 +853,7 @@ bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr
|
| clearSelectionIfNeeded(oldFocusedFrame.get(), toLocalFrame(newFocusedFrame.get()), element);
|
|
|
| if (oldDocument && oldDocument != newDocument)
|
| - oldDocument->setFocusedElement(nullptr);
|
| + oldDocument->clearFocusedElement();
|
|
|
| if (newFocusedFrame && !newFocusedFrame->page()) {
|
| setFocusedFrame(nullptr);
|
| @@ -860,7 +865,7 @@ bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr
|
| RefPtrWillBeRawPtr<Element> protect = element;
|
| ALLOW_UNUSED_LOCAL(protect);
|
| if (newDocument) {
|
| - bool successfullyFocused = newDocument->setFocusedElement(element, type, sourceCapabilities);
|
| + bool successfullyFocused = newDocument->setFocusedElement(element, params);
|
| if (!successfullyFocused)
|
| return false;
|
| }
|
|
|