Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index ff699d8b21e0cb702e42b06a18cc5bcce3318583..9b5b99042532a54e4da2725f2641498bd1d36814 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -995,7 +995,8 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionState& ex |
| if (source->isFrameOwnerElement()) { |
| HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(source.get()); |
| - if (frame() && frame()->tree().isDescendantOf(frameOwnerElement->contentFrame())) { |
| + // FIXME(kenrb): the toLocalFrame() cast should be removed when the FrameTree supports RemoteFrames. |
| + if (frame() && frame()->tree().isDescendantOf(toLocalFrame(frameOwnerElement->contentFrame()))) { |
|
eseidel
2014/03/21 19:01:35
Why not just add the check now? What would this c
kenrb
2014/03/21 19:59:31
It will pass a Frame to the FrameTree rather than
|
| exceptionState.throwDOMException(HierarchyRequestError, "The node provided is a frame which contains this document."); |
| return nullptr; |
| } |
| @@ -5448,9 +5449,9 @@ bool Document::hasFocus() const |
| Page* page = this->page(); |
| if (!page) |
| return false; |
| - if (!page->focusController().isActive() || !page->focusController().isFocused()) |
| + if (!page->focusController().isActive() || !page->focusController().isFocused() || !page->focusController().focusedFrame()->isLocalFrame()) |
| return false; |
| - if (LocalFrame* focusedFrame = page->focusController().focusedFrame()) { |
| + if (LocalFrame* focusedFrame = toLocalFrame(page->focusController().focusedFrame())) { |
|
eseidel
2014/03/21 19:01:35
Does this make sense? Will the Document be able t
kenrb
2014/03/21 19:59:31
I think so. We haven't started writing any code fo
|
| if (focusedFrame->tree().isDescendantOf(frame())) |
| return true; |
| } |