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

Side by Side 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, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5426 matching lines...) Expand 10 before | Expand all | Expand 10 after
5437 if (Element* element = treeScope().adjustedFocusedElement()) 5437 if (Element* element = treeScope().adjustedFocusedElement())
5438 return element; 5438 return element;
5439 return body(); 5439 return body();
5440 } 5440 }
5441 5441
5442 bool Document::hasFocus() const 5442 bool Document::hasFocus() const
5443 { 5443 {
5444 Page* page = this->page(); 5444 Page* page = this->page();
5445 if (!page) 5445 if (!page)
5446 return false; 5446 return false;
5447 if (!page->focusController().isActive() || !page->focusController().isFocuse d() || !page->focusController().focusedFrame()->isLocalFrame()) 5447 if (!page->focusController().isActive() || !page->focusController().isFocuse d())
5448 return false; 5448 return false;
5449 if (LocalFrame* focusedFrame = toLocalFrame(page->focusController().focusedF rame())) { 5449 Frame* focusedFrame = page->focusController().focusedFrame();
5450 if (focusedFrame->tree().isDescendantOf(frame())) 5450 if (focusedFrame && focusedFrame->isLocalFrame()) {
5451 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame()))
5451 return true; 5452 return true;
5452 } 5453 }
5453 return false; 5454 return false;
5454 } 5455 }
5455 5456
5456 // FIXME: Remove this code once we have input routing in the browser 5457 // FIXME: Remove this code once we have input routing in the browser
5457 // process. See http://crbug.com/339659. 5458 // process. See http://crbug.com/339659.
5458 void Document::defaultEventHandler(Event* event) 5459 void Document::defaultEventHandler(Event* event)
5459 { 5460 {
5460 if (frame() && frame()->remotePlatformLayer()) { 5461 if (frame() && frame()->remotePlatformLayer()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5492 } 5493 }
5493 5494
5494 void Document::invalidateNodeListCaches(const QualifiedName* attrName) 5495 void Document::invalidateNodeListCaches(const QualifiedName* attrName)
5495 { 5496 {
5496 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( ); 5497 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( );
5497 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it) 5498 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it)
5498 (*it)->invalidateCache(attrName); 5499 (*it)->invalidateCache(attrName);
5499 } 5500 }
5500 5501
5501 } // namespace WebCore 5502 } // namespace WebCore
OLDNEW
« 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