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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 } 979 }
980 default: 980 default:
981 if (source->isShadowRoot()) { 981 if (source->isShadowRoot()) {
982 // ShadowRoot cannot disconnect itself from the host node. 982 // ShadowRoot cannot disconnect itself from the host node.
983 exceptionState.throwDOMException(HierarchyRequestError, "The node pr ovided is a shadow root, which may not be adopted."); 983 exceptionState.throwDOMException(HierarchyRequestError, "The node pr ovided is a shadow root, which may not be adopted.");
984 return nullptr; 984 return nullptr;
985 } 985 }
986 986
987 if (source->isFrameOwnerElement()) { 987 if (source->isFrameOwnerElement()) {
988 HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(s ource.get()); 988 HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(s ource.get());
989 // FIXME(kenrb): the downcast can be removed when the FrameTree supp orts RemoteFrames. 989 if (frame() && frame()->tree().isDescendantOf(frameOwnerElement->con tentFrame())) {
990 if (frame() && frame()->tree().isDescendantOf(toLocalFrameTemporary( frameOwnerElement->contentFrame()))) {
991 exceptionState.throwDOMException(HierarchyRequestError, "The nod e provided is a frame which contains this document."); 990 exceptionState.throwDOMException(HierarchyRequestError, "The nod e provided is a frame which contains this document.");
992 return nullptr; 991 return nullptr;
993 } 992 }
994 } 993 }
995 if (source->parentNode()) { 994 if (source->parentNode()) {
996 source->parentNode()->removeChild(source.get(), exceptionState); 995 source->parentNode()->removeChild(source.get(), exceptionState);
997 if (exceptionState.hadException()) 996 if (exceptionState.hadException())
998 return nullptr; 997 return nullptr;
999 } 998 }
1000 } 999 }
(...skipping 4436 matching lines...) Expand 10 before | Expand all | Expand 10 after
5437 if (Element* element = treeScope().adjustedFocusedElement()) 5436 if (Element* element = treeScope().adjustedFocusedElement())
5438 return element; 5437 return element;
5439 return body(); 5438 return body();
5440 } 5439 }
5441 5440
5442 bool Document::hasFocus() const 5441 bool Document::hasFocus() const
5443 { 5442 {
5444 Page* page = this->page(); 5443 Page* page = this->page();
5445 if (!page) 5444 if (!page)
5446 return false; 5445 return false;
5447 if (!page->focusController().isActive() || !page->focusController().isFocuse d() || !page->focusController().focusedFrame()->isLocalFrame()) 5446 if (!page->focusController().isActive() || !page->focusController().isFocuse d())
5448 return false; 5447 return false;
5449 if (LocalFrame* focusedFrame = toLocalFrame(page->focusController().focusedF rame())) { 5448 if (LocalFrame* focusedFrame = page->focusController().focusedFrame()) {
5450 if (focusedFrame->tree().isDescendantOf(frame())) 5449 if (focusedFrame->tree().isDescendantOf(frame()))
5451 return true; 5450 return true;
5452 } 5451 }
5453 return false; 5452 return false;
5454 } 5453 }
5455 5454
5456 // FIXME: Remove this code once we have input routing in the browser 5455 // FIXME: Remove this code once we have input routing in the browser
5457 // process. See http://crbug.com/339659. 5456 // process. See http://crbug.com/339659.
5458 void Document::defaultEventHandler(Event* event) 5457 void Document::defaultEventHandler(Event* event)
5459 { 5458 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
5492 } 5491 }
5493 5492
5494 void Document::invalidateNodeListCaches(const QualifiedName* attrName) 5493 void Document::invalidateNodeListCaches(const QualifiedName* attrName)
5495 { 5494 {
5496 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( ); 5495 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( );
5497 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it) 5496 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it)
5498 (*it)->invalidateCache(attrName); 5497 (*it)->invalidateCache(attrName);
5499 } 5498 }
5500 5499
5501 } // namespace WebCore 5500 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698