Chromium Code Reviews| 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 c7d11a226f30bdcff86214c2462d43f70a5ee4cc..a5bd053d02a018cff93abb58b57cbbbbfe792803 100644 |
| --- a/third_party/WebKit/Source/core/page/FocusController.cpp |
| +++ b/third_party/WebKit/Source/core/page/FocusController.cpp |
| @@ -772,6 +772,11 @@ void FocusController::focusDocumentView(Frame* frame, bool notifyEmbedder) |
| dispatchFocusEvent(*document, *focusedElement); |
| } |
| + // dispatchBlurEvent/dispatchFocusEvent could have changed the focused frame, or |
| + // detached the frame. |
| + if (newFocusedFrame && !newFocusedFrame->selection().isAvailable()) |
|
yosin_UTC9
2016/07/21 06:10:10
It is better to use |newFocusedFrame && newFocused
kochi
2016/07/21 06:55:26
Done.
|
| + return; |
| + |
| setFocusedFrame(frame, notifyEmbedder); |
| } |
| @@ -1115,9 +1120,10 @@ void FocusController::setActive(bool active) |
| // Invalidate all custom scrollbars because they support the CSS |
| // window-active attribute. This should be applied to the entire page so |
| // we invalidate from the root FrameView instead of just the focused. |
| - if (FrameView* view = toLocalFrame(frame)->localFrameRoot()->document()->view()) |
| + if (FrameView* view = toLocalFrame(frame)->localFrameRoot()->document()->view()) { |
| view->invalidateAllCustomScrollbarsOnActiveChanged(); |
| - toLocalFrame(frame)->selection().pageActivationChanged(); |
| + toLocalFrame(frame)->selection().pageActivationChanged(); |
|
yosin_UTC9
2016/07/21 06:10:10
Can we assume that |localFrameRoot()->view() != nu
kochi
2016/07/21 06:55:26
Agree that |->view()| doesn't imply |selection().i
|
| + } |
| } |
| } |