Commit 6d3806e4 authored by sky@chromium.org's avatar sky@chromium.org

Fixed two bugs related to OOPIFs

. FocusController::setFocusedElement() assumes the focusedFrame() is
  local.
. ChromeClientImpl assumes webview client is non-null.

BUG=522260
TEST=none
R=japhet@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@200766 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bf9b7c80
......@@ -799,7 +799,7 @@ static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, LocalFrame* newF
bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr<Frame> newFocusedFrame, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
{
RefPtrWillBeRawPtr<LocalFrame> oldFocusedFrame = toLocalFrame(focusedFrame());
RefPtrWillBeRawPtr<LocalFrame> oldFocusedFrame = focusedFrame() && focusedFrame()->isLocalFrame() ? toLocalFrame(focusedFrame()) : nullptr;
RefPtrWillBeRawPtr<Document> oldDocument = oldFocusedFrame ? oldFocusedFrame->document() : nullptr;
Element* oldFocusedElement = oldDocument ? oldDocument->focusedElement() : nullptr;
......
......@@ -194,6 +194,9 @@ void ChromeClientImpl::takeFocus(WebFocusType type)
void ChromeClientImpl::focusedNodeChanged(Node* fromNode, Node* toNode)
{
if (!m_webView->client())
return;
m_webView->client()->focusedNodeChanged(WebNode(fromNode), WebNode(toNode));
WebURL focusURL;
......
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