Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: Source/core/dom/Document.cpp

Issue 219453004: Correct the null focusedFrame() check in Document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index e9e7627af18eeb908b7a20e814ba60491f24d140..992c8401d322137335ad6b168cef8dee9264884a 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -5444,10 +5444,11 @@ bool Document::hasFocus() const
Page* page = this->page();
if (!page)
return false;
- if (!page->focusController().isActive() || !page->focusController().isFocused() || !page->focusController().focusedFrame()->isLocalFrame())
+ if (!page->focusController().isActive() || !page->focusController().isFocused())
return false;
- if (LocalFrame* focusedFrame = toLocalFrame(page->focusController().focusedFrame())) {
- if (focusedFrame->tree().isDescendantOf(frame()))
+ Frame* focusedFrame = page->focusController().focusedFrame();
+ if (focusedFrame && focusedFrame->isLocalFrame()) {
+ if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame()))
return true;
}
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698